home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 15 / BBS in a box XV-2.iso / Files II / Prog / U-Z / VideoToolbox 4.95.sit / VideoToolbox / VideoToolboxSources / Luminance.note < prev    next >
MacBinary  |  1994-10-25  |  24.5 KB  |  [TEXT/MMCC]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, Tue Oct 25 02:42:51 1994, modified Tue Oct 25 02:42:51 1994, creator 'MMCC', type ASCII, 24455 bytes "Luminance.note" , at 0x6007 382 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[MMCC]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0e 4c 75 6d 69 6e 61 | 6e 63 65 2e 6e 6f 74 65 |..Lumina|nce.note|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4d 4d 43 | 43 00 00 00 00 00 00 00 |.TEXTMMC|C.......|
|00000050| 00 00 00 00 00 5f 87 00 | 00 01 7e aa d2 59 6b aa |....._..|..~..Yk.|
|00000060| d2 59 6b 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.Yk.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 bf c5 00 00 |........|........|
|00000080| 23 69 66 20 30 0d 4c 75 | 6d 69 6e 61 6e 63 65 2e |#if 0.Lu|minance.|
|00000090| 6e 6f 74 65 0d 54 68 69 | 73 20 66 69 6c 65 20 64 |note.Thi|s file d|
|000000a0| 6f 63 75 6d 65 6e 74 73 | 20 4c 75 6d 69 6e 61 6e |ocuments| Luminan|
|000000b0| 63 65 2e 63 2e 0d 0d 48 | 49 53 54 4f 52 59 3a 0d |ce.c...H|ISTORY:.|
|000000c0| 33 2f 31 31 2f 39 32 20 | 64 67 70 20 61 64 64 65 |3/11/92 |dgp adde|
|000000d0| 64 20 70 72 6f 74 6f 74 | 79 70 65 73 20 74 6f 20 |d protot|ypes to |
|000000e0| 73 75 70 70 6c 65 6d 65 | 6e 74 20 74 68 65 20 65 |suppleme|nt the e|
|000000f0| 78 70 6c 61 6e 61 74 69 | 6f 6e 73 20 6f 66 20 74 |xplanati|ons of t|
|00000100| 68 65 20 72 6f 75 74 69 | 6e 65 73 2e 0d 33 2f 32 |he routi|nes..3/2|
|00000110| 34 2f 39 34 09 64 67 70 | 20 61 64 64 65 64 20 4c |4/94.dgp| added L|
|00000120| 54 6f 45 2c 20 4c 54 6f | 45 4f 72 64 65 72 65 64 |ToE, LTo|EOrdered|
|00000130| 2c 20 61 6e 64 20 45 54 | 6f 4c 2e 0d 31 30 2f 31 |, and ET|oL..10/1|
|00000140| 37 2f 39 34 20 64 67 70 | 20 75 70 64 61 74 65 64 |7/94 dgp| updated|
|00000150| 2c 20 69 6e 20 72 65 73 | 70 6f 6e 73 65 20 74 6f |, in res|ponse to|
|00000160| 20 71 75 65 72 69 65 73 | 20 62 79 20 4c 61 6e 20 | queries| by Lan |
|00000170| 5a 68 61 6e 67 2e 0d 0d | 49 4e 54 52 4f 44 55 43 |Zhang...|INTRODUC|
|00000180| 54 49 4f 4e 3a 0d 0d 54 | 68 65 20 70 75 72 70 6f |TION:..T|he purpo|
|00000190| 73 65 20 6f 66 20 74 68 | 65 73 65 20 73 75 62 72 |se of th|ese subr|
|000001a0| 6f 75 74 69 6e 65 73 20 | 69 73 20 61 63 63 75 72 |outines |is accur|
|000001b0| 61 74 65 20 63 6f 6e 74 | 72 6f 6c 20 6f 66 20 63 |ate cont|rol of c|
|000001c0| 6f 6e 74 72 61 73 74 20 | 6f 66 20 76 69 73 75 61 |ontrast |of visua|
|000001d0| 6c 20 0d 73 74 69 6d 75 | 6c 69 20 66 6f 72 20 76 |l .stimu|li for v|
|000001e0| 69 73 69 6f 6e 20 65 78 | 70 65 72 69 6d 65 6e 74 |ision ex|periment|
|000001f0| 73 2e 20 54 68 65 73 65 | 20 73 75 62 72 6f 75 74 |s. These| subrout|
|00000200| 69 6e 65 73 20 73 65 74 | 20 75 70 20 74 68 65 20 |ines set| up the |
|00000210| 43 6f 6c 6f 72 20 4c 6f | 6f 6b 75 70 20 54 61 62 |Color Lo|okup Tab|
|00000220| 6c 65 20 0d 28 43 4c 55 | 54 29 20 6f 66 20 61 20 |le .(CLU|T) of a |
|00000230| 76 69 64 65 6f 20 66 72 | 61 6d 65 73 74 6f 72 65 |video fr|amestore|
|00000240| 20 6f 6e 20 74 68 65 20 | 4d 61 63 20 49 49 20 28 | on the |Mac II (|
|00000250| 65 2e 67 2e 20 74 68 65 | 20 41 70 70 6c 65 20 4d |e.g. the| Apple M|
|00000260| 61 63 20 49 49 20 43 6f | 6c 6f 72 20 56 69 64 65 |ac II Co|lor Vide|
|00000270| 6f 20 0d 43 61 72 64 29 | 20 74 6f 20 70 72 6f 70 |o .Card)| to prop|
|00000280| 65 72 6c 79 20 64 72 69 | 76 65 20 61 20 6d 6f 6e |erly dri|ve a mon|
|00000290| 6f 63 68 72 6f 6d 65 20 | 6d 6f 6e 69 74 6f 72 20 |ochrome |monitor |
|000002a0| 28 65 2e 67 2e 20 74 68 | 65 20 41 70 70 6c 65 20 |(e.g. th|e Apple |
|000002b0| 48 69 67 68 20 52 65 73 | 6f 6c 75 74 69 6f 6e 20 |High Res|olution |
|000002c0| 0d 4d 6f 6e 6f 63 68 72 | 6f 6d 65 20 4d 6f 6e 69 |.Monochr|ome Moni|
|000002d0| 74 6f 72 29 20 76 69 61 | 20 61 6e 20 49 6e 73 74 |tor) via| an Inst|
|000002e0| 69 74 75 74 65 20 66 6f | 72 20 53 65 6e 73 6f 72 |itute fo|r Sensor|
|000002f0| 79 20 52 65 73 65 61 72 | 63 68 20 28 49 53 52 29 |y Resear|ch (ISR)|
|00000300| 20 56 69 64 65 6f 20 0d | 41 74 74 65 6e 75 61 74 | Video .|Attenuat|
|00000310| 6f 72 2e 20 54 68 65 20 | 49 53 52 20 56 69 64 65 |or. The |ISR Vide|
|00000320| 6f 20 41 74 74 65 6e 75 | 61 74 6f 72 20 63 6f 6e |o Attenu|ator con|
|00000330| 73 69 73 74 73 20 6f 66 | 20 72 65 73 69 73 74 69 |sists of| resisti|
|00000340| 76 65 20 64 69 76 69 64 | 65 72 73 20 77 68 69 63 |ve divid|ers whic|
|00000350| 68 20 0d 61 74 74 65 6e | 75 61 74 65 20 74 68 65 |h .atten|uate the|
|00000360| 20 74 68 72 65 65 20 63 | 6f 6c 6f 72 20 73 69 67 | three c|olor sig|
|00000370| 6e 61 6c 20 66 72 6f 6d | 20 74 68 65 20 76 69 64 |nal from| the vid|
|00000380| 65 6f 20 66 72 61 6d 65 | 73 74 6f 72 65 20 62 79 |eo frame|store by|
|00000390| 20 64 69 66 66 65 72 65 | 6e 74 20 0d 61 6d 6f 75 | differe|nt .amou|
|000003a0| 6e 74 73 20 61 6e 64 20 | 63 6f 6d 62 69 6e 65 20 |nts and |combine |
|000003b0| 74 68 65 6d 20 74 6f 20 | 70 72 6f 64 75 63 65 20 |them to |produce |
|000003c0| 6f 6e 65 20 6d 6f 6e 6f | 63 68 72 6f 6d 65 20 73 |one mono|chrome s|
|000003d0| 69 67 6e 61 6c 2e 0d 0d | 54 68 65 20 76 69 64 65 |ignal...|The vide|
|000003e0| 6f 20 61 74 74 65 6e 75 | 61 74 6f 72 20 61 6e 64 |o attenu|ator and|
|000003f0| 20 74 68 65 20 74 68 65 | 6f 72 79 20 62 65 68 69 | the the|ory behi|
|00000400| 6e 64 20 74 68 65 20 61 | 6c 67 6f 72 69 74 68 6d |nd the a|lgorithm|
|00000410| 73 20 64 65 73 63 72 69 | 62 65 64 20 68 65 72 65 |s descri|bed here|
|00000420| 20 61 72 65 0d 74 68 65 | 20 74 6f 70 69 63 20 6f | are.the| topic o|
|00000430| 66 20 61 20 70 61 70 65 | 72 3a 0d 44 2e 47 2e 20 |f a pape|r:.D.G. |
|00000440| 50 65 6c 6c 69 20 61 6e | 64 20 4c 2e 20 5a 68 61 |Pelli an|d L. Zha|
|00000450| 6e 67 20 28 31 39 39 31 | 29 20 41 63 63 75 72 61 |ng (1991|) Accura|
|00000460| 74 65 20 63 6f 6e 74 72 | 6f 6c 20 6f 66 20 63 6f |te contr|ol of co|
|00000470| 6e 74 72 61 73 74 20 6f | 6e 20 6d 69 63 72 6f 63 |ntrast o|n microc|
|00000480| 6f 6d 70 75 74 65 72 20 | 64 69 73 70 6c 61 79 73 |omputer |displays|
|00000490| 2e 20 0d 56 69 73 69 6f | 6e 20 52 65 73 65 61 72 |. .Visio|n Resear|
|000004a0| 63 68 2c 20 33 31 3a 31 | 33 33 37 2d 31 33 36 30 |ch, 31:1|337-1360|
|000004b0| 2e 0d 0d 41 63 68 69 65 | 76 69 6e 67 20 74 68 65 |...Achie|ving the|
|000004c0| 20 67 6f 61 6c 20 6f 66 | 20 61 63 63 75 72 61 74 | goal of| accurat|
|000004d0| 65 20 63 6f 6e 74 72 6f | 6c 20 6f 66 20 63 6f 6e |e contro|l of con|
|000004e0| 74 72 61 73 74 20 72 65 | 71 75 69 72 65 64 20 73 |trast re|quired s|
|000004f0| 6f 6c 76 69 6e 67 20 66 | 69 76 65 20 0d 70 72 6f |olving f|ive .pro|
|00000500| 62 6c 65 6d 73 3a 0d 31 | 2e 20 54 68 65 20 6c 75 |blems:.1|. The lu|
|00000510| 6d 69 6e 61 6e 63 65 20 | 6f 66 20 74 68 65 20 6d |minance |of the m|
|00000520| 6f 6e 69 74 6f 72 20 69 | 73 20 6e 6f 6e 6c 69 6e |onitor i|s nonlin|
|00000530| 65 61 72 6c 79 20 72 65 | 6c 61 74 65 64 20 74 6f |early re|lated to|
|00000540| 20 74 68 65 20 69 6e 70 | 75 74 20 76 6f 6c 74 61 | the inp|ut volta|
|00000550| 67 65 0d 77 68 69 63 68 | 20 64 65 70 65 6e 64 73 |ge.which| depends|
|00000560| 20 6c 69 6e 65 61 72 6c | 79 20 6f 6e 20 74 68 65 | linearl|y on the|
|00000570| 20 74 72 69 70 6c 65 74 | 20 6c 6f 61 64 65 64 20 | triplet| loaded |
|00000580| 69 6e 74 6f 20 74 68 65 | 20 43 4c 55 54 2e 20 54 |into the| CLUT. T|
|00000590| 68 69 73 20 69 73 20 73 | 6f 6c 76 65 64 20 62 79 |his is s|olved by|
|000005a0| 0d 61 6c 6c 6f 77 69 6e | 67 20 74 68 65 20 75 73 |.allowin|g the us|
|000005b0| 65 72 20 74 6f 20 70 72 | 6f 76 69 64 65 20 61 20 |er to pr|ovide a |
|000005c0| 70 6f 6c 79 6e 6f 6d 69 | 61 6c 20 28 49 20 72 65 |polynomi|al (I re|
|000005d0| 63 6f 6d 6d 65 6e 64 20 | 34 74 68 20 6f 72 64 65 |commend |4th orde|
|000005e0| 72 29 20 64 65 73 63 72 | 69 62 69 6e 67 20 74 68 |r) descr|ibing th|
|000005f0| 65 0d 6e 6f 6e 6c 69 6e | 65 61 72 20 72 65 6c 61 |e.nonlin|ear rela|
|00000600| 74 69 6f 6e 73 68 69 70 | 20 62 65 74 77 65 65 6e |tionship| between|
|00000610| 20 6c 75 6d 69 6e 61 6e | 63 65 20 61 6e 64 20 6e | luminan|ce and n|
|00000620| 6f 6d 69 6e 61 6c 20 76 | 6f 6c 74 61 67 65 2e 20 |ominal v|oltage. |
|00000630| 28 46 6f 72 20 63 6f 6d | 70 75 74 61 74 69 6f 6e |(For com|putation|
|00000640| 61 6c 0d 72 65 61 73 6f | 6e 73 2c 20 79 6f 75 20 |al.reaso|ns, you |
|00000650| 6d 75 73 74 20 61 6c 73 | 6f 20 73 75 70 70 6c 79 |must als|o supply|
|00000660| 20 61 20 71 75 61 64 72 | 61 74 69 63 20 66 69 74 | a quadr|atic fit|
|00000670| 2e 29 20 54 68 65 20 73 | 75 62 72 6f 75 74 69 6e |.) The s|ubroutin|
|00000680| 65 73 20 4c 54 6f 56 20 | 61 6e 64 20 56 54 6f 4c |es LToV |and VToL|
|00000690| 0d 75 73 65 20 74 68 69 | 73 20 70 6f 6c 79 6e 6f |.use thi|s polyno|
|000006a0| 6d 69 61 6c 20 74 6f 20 | 63 6f 6e 76 65 72 74 20 |mial to |convert |
|000006b0| 62 61 63 6b 20 61 6e 64 | 20 66 6f 72 74 68 2e 0d |back and| forth..|
|000006c0| 32 2e 20 41 66 66 6f 72 | 64 61 62 6c 65 20 66 72 |2. Affor|dable fr|
|000006d0| 61 6d 65 73 74 6f 72 65 | 73 20 66 6f 72 20 6d 69 |amestore|s for mi|
|000006e0| 63 72 6f 63 6f 6d 70 75 | 74 65 72 73 20 68 61 76 |crocompu|ters hav|
|000006f0| 65 20 38 20 62 69 74 20 | 44 69 67 69 74 61 6c 20 |e 8 bit |Digital |
|00000700| 74 6f 20 41 6e 61 6c 6f | 67 0d 43 6f 6e 76 65 72 |to Analo|g.Conver|
|00000710| 74 65 72 73 20 28 44 41 | 43 73 29 2c 20 77 68 69 |ters (DA|Cs), whi|
|00000720| 63 68 20 63 61 6e 20 6f | 6e 6c 79 20 72 65 70 72 |ch can o|nly repr|
|00000730| 65 73 65 6e 74 20 32 35 | 36 20 64 69 66 66 65 72 |esent 25|6 differ|
|00000740| 65 6e 74 20 6c 75 6d 69 | 6e 61 6e 63 65 73 2e 20 |ent lumi|nances. |
|00000750| 54 68 69 73 20 69 73 0d | 6e 6f 74 20 65 6e 6f 75 |This is.|not enou|
|00000760| 67 68 20 70 72 65 63 69 | 73 69 6f 6e 20 74 6f 20 |gh preci|sion to |
|00000770| 70 72 6f 64 75 63 65 20 | 74 68 72 65 73 68 6f 6c |produce |threshol|
|00000780| 64 2d 63 6f 6e 74 72 61 | 73 74 20 70 61 74 74 65 |d-contra|st patte|
|00000790| 72 6e 73 2c 20 77 68 69 | 63 68 20 61 72 65 20 69 |rns, whi|ch are i|
|000007a0| 6d 70 6f 72 74 61 6e 74 | 0d 66 6f 72 20 76 69 73 |mportant|.for vis|
|000007b0| 69 6f 6e 20 65 78 70 65 | 72 69 6d 65 6e 74 73 2e |ion expe|riments.|
|000007c0| 20 54 68 69 73 20 69 73 | 20 73 6f 6c 76 65 64 20 | This is| solved |
|000007d0| 62 79 20 74 68 65 20 49 | 53 52 20 56 69 64 65 6f |by the I|SR Video|
|000007e0| 20 41 74 74 65 6e 75 61 | 74 6f 72 20 77 68 69 63 | Attenua|tor whic|
|000007f0| 68 0d 63 6f 6d 62 69 6e | 65 73 20 74 68 65 20 6f |h.combin|es the o|
|00000800| 75 74 70 75 74 73 20 6f | 66 20 74 68 65 20 74 68 |utputs o|f the th|
|00000810| 72 65 65 20 44 41 43 73 | 20 28 22 72 65 64 22 2c |ree DACs| ("red",|
|00000820| 20 22 67 72 65 65 6e 22 | 2c 20 61 6e 64 20 22 62 | "green"|, and "b|
|00000830| 6c 75 65 22 29 20 77 69 | 74 68 20 76 61 72 69 6f |lue") wi|th vario|
|00000840| 75 73 0d 61 74 74 65 6e | 75 61 74 69 6f 6e 73 20 |us.atten|uations |
|00000850| 74 6f 20 79 69 65 6c 64 | 20 6f 6e 65 20 6d 6f 6e |to yield| one mon|
|00000860| 6f 63 68 72 6f 6d 65 20 | 73 69 67 6e 61 6c 20 77 |ochrome |signal w|
|00000870| 68 69 63 68 20 63 61 6e | 20 72 65 70 72 65 73 65 |hich can| represe|
|00000880| 6e 74 20 6c 6f 77 20 63 | 6f 6e 74 72 61 73 74 73 |nt low c|ontrasts|
|00000890| 0d 28 62 79 20 76 61 72 | 79 69 6e 67 20 61 6e 20 |.(by var|ying an |
|000008a0| 61 74 74 65 6e 75 61 74 | 65 64 20 44 41 43 29 20 |attenuat|ed DAC) |
|000008b0| 61 6e 64 20 68 69 67 68 | 20 63 6f 6e 74 72 61 73 |and high| contras|
|000008c0| 74 73 20 28 62 79 20 76 | 61 72 79 69 6e 67 20 61 |ts (by v|arying a|
|000008d0| 6e 20 75 6e 61 74 74 65 | 6e 75 61 74 65 64 0d 44 |n unatte|nuated.D|
|000008e0| 41 43 29 2e 0d 33 2e 20 | 44 41 43 73 20 61 72 65 |AC)..3. |DACs are|
|000008f0| 20 6f 6e 6c 79 20 61 63 | 63 75 72 61 74 65 20 74 | only ac|curate t|
|00000900| 6f 20 b1 20 61 20 6c 65 | 61 73 74 20 73 69 67 6e |o . a le|ast sign|
|00000910| 69 66 69 63 61 6e 74 20 | 62 69 74 20 28 4c 53 42 |ificant |bit (LSB|
|00000920| 29 2e 20 54 68 65 20 42 | 72 6f 6f 6b 74 72 65 65 |). The B|rooktree|
|00000930| 20 44 41 43 73 0d 75 73 | 65 64 20 62 79 20 41 70 | DACs.us|ed by Ap|
|00000940| 70 6c 65 20 61 6e 64 20 | 52 61 73 74 65 72 4f 70 |ple and |RasterOp|
|00000950| 73 20 61 72 65 20 73 70 | 65 63 69 66 69 65 64 20 |s are sp|ecified |
|00000960| 74 6f 20 68 61 76 65 20 | 61 20 b1 31 20 4c 53 42 |to have |a .1 LSB|
|00000970| 20 22 69 6e 74 65 67 72 | 61 74 65 64 0d 6c 69 6e | "integr|ated.lin|
|00000980| 65 61 72 69 74 79 22 20 | 65 72 72 6f 72 2c 20 77 |earity" |error, w|
|00000990| 68 69 63 68 20 6d 65 61 | 6e 73 20 74 68 61 74 20 |hich mea|ns that |
|000009a0| 74 68 65 20 76 6f 6c 74 | 61 67 65 20 70 72 6f 64 |the volt|age prod|
|000009b0| 75 63 65 64 20 62 79 20 | 61 6e 79 20 6e 75 6d 62 |uced by |any numb|
|000009c0| 65 72 20 77 69 6c 6c 0d | 64 65 76 69 61 74 65 20 |er will.|deviate |
|000009d0| 66 72 6f 6d 20 61 20 6c | 69 6e 65 20 63 6f 6e 6e |from a l|ine conn|
|000009e0| 65 63 74 69 6e 67 20 74 | 68 65 20 30 20 61 6e 64 |ecting t|he 0 and|
|000009f0| 20 32 35 35 20 70 6f 69 | 6e 74 73 20 62 79 20 61 | 255 poi|nts by a|
|00000a00| 74 20 6d 6f 73 74 20 31 | 20 4c 53 42 2c 20 77 68 |t most 1| LSB, wh|
|00000a10| 69 63 68 20 69 73 0d 64 | 65 66 69 6e 65 64 20 61 |ich is.d|efined a|
|00000a20| 73 20 31 2f 32 35 35 20 | 74 69 6d 65 73 20 74 68 |s 1/255 |times th|
|00000a30| 65 20 76 6f 6c 74 61 67 | 65 20 64 69 66 66 65 72 |e voltag|e differ|
|00000a40| 65 6e 63 65 20 62 65 74 | 77 65 65 6e 20 30 20 61 |ence bet|ween 0 a|
|00000a50| 6e 64 20 32 35 35 2e 20 | 49 20 61 73 73 75 6d 65 |nd 255. |I assume|
|00000a60| 20 61 0d 73 6c 69 67 68 | 74 6c 79 20 73 74 72 6f | a.sligh|tly stro|
|00000a70| 6e 67 65 72 20 72 65 73 | 74 72 69 63 74 69 6f 6e |nger res|triction|
|00000a80| 20 77 69 6c 6c 20 68 6f | 6c 64 2c 20 74 68 61 74 | will ho|ld, that|
|00000a90| 20 74 68 65 20 64 69 66 | 66 65 72 65 6e 63 65 20 | the dif|ference |
|00000aa0| 62 65 74 77 65 65 6e 20 | 61 6e 79 20 74 77 6f 0d |between |any two.|
|00000ab0| 73 65 74 74 69 6e 67 73 | 20 77 69 6c 6c 20 62 65 |settings| will be|
|00000ac0| 20 69 6e 20 65 72 72 6f | 72 20 62 79 20 61 74 20 | in erro|r by at |
|00000ad0| 6d 6f 73 74 20 6f 6e 65 | 20 4c 53 42 2e 20 53 6f |most one| LSB. So|
|00000ae0| 20 69 74 20 69 73 20 69 | 6d 70 6f 72 74 61 6e 74 | it is i|mportant|
|00000af0| 20 74 6f 20 61 6c 6c 6f | 77 20 74 68 65 0d 75 73 | to allo|w the.us|
|00000b00| 65 72 20 74 6f 20 73 70 | 65 63 69 66 79 20 77 68 |er to sp|ecify wh|
|00000b10| 61 74 20 72 61 6e 67 65 | 20 6f 66 20 6c 75 6d 69 |at range| of lumi|
|00000b20| 6e 61 6e 63 65 73 20 77 | 69 6c 6c 20 62 65 20 75 |nances w|ill be u|
|00000b30| 73 65 64 20 74 6f 20 70 | 72 65 73 65 6e 74 20 61 |sed to p|resent a|
|00000b40| 20 70 61 72 74 69 63 75 | 6c 61 72 0d 73 74 69 6d | particu|lar.stim|
|00000b50| 75 6c 75 73 20 61 6e 64 | 20 74 6f 20 66 69 78 20 |ulus and| to fix |
|00000b60| 74 68 65 20 63 6f 61 72 | 73 65 73 74 20 44 41 43 |the coar|sest DAC|
|00000b70| 73 20 28 69 2e 65 2e 20 | 74 68 6f 73 65 20 77 69 |s (i.e. |those wi|
|00000b80| 74 68 20 74 68 65 20 6c | 65 61 73 74 20 61 74 74 |th the l|east att|
|00000b90| 65 6e 75 61 74 69 6f 6e | 20 69 6e 0d 74 68 65 20 |enuation| in.the |
|00000ba0| 49 53 52 20 56 69 64 65 | 6f 20 41 74 74 65 6e 75 |ISR Vide|o Attenu|
|00000bb0| 61 74 6f 72 29 20 61 6e | 64 20 6f 6e 6c 79 20 76 |ator) an|d only v|
|00000bc0| 61 72 79 20 74 68 65 20 | 66 69 6e 65 20 44 41 43 |ary the |fine DAC|
|00000bd0| 73 20 74 6f 20 70 72 6f | 64 75 63 65 20 74 68 65 |s to pro|duce the|
|00000be0| 20 73 70 65 63 69 66 69 | 65 64 0d 6c 75 6d 69 6e | specifi|ed.lumin|
|00000bf0| 61 6e 63 65 73 2e 20 54 | 68 65 20 72 61 6e 67 65 |ances. T|he range|
|00000c00| 20 73 65 74 74 69 6e 67 | 20 69 73 20 64 6f 6e 65 | setting| is done|
|00000c10| 20 62 79 20 53 65 74 4c | 75 6d 69 6e 61 6e 63 65 | by SetL|uminance|
|00000c20| 52 61 6e 67 65 28 29 20 | 77 68 69 63 68 20 69 73 |Range() |which is|
|00000c30| 20 63 61 6c 6c 65 64 0d | 61 75 74 6f 6d 61 74 69 | called.|automati|
|00000c40| 63 61 6c 6c 79 20 62 79 | 20 53 65 74 4c 75 6d 69 |cally by| SetLumi|
|00000c50| 6e 61 6e 63 65 28 29 20 | 61 6e 64 20 53 65 74 4c |nance() |and SetL|
|00000c60| 75 6d 69 6e 61 6e 63 65 | 73 28 29 2e 0d 34 2e 20 |uminance|s()..4. |
|00000c70| 41 70 70 6c 65 27 73 20 | 73 6f 66 74 77 61 72 65 |Apple's |software|
|00000c80| 20 65 6e 76 69 72 6f 6e | 6d 65 6e 74 20 66 6f 72 | environ|ment for|
|00000c90| 20 67 72 61 70 68 69 63 | 73 2c 20 51 75 69 63 6b | graphic|s, Quick|
|00000ca0| 44 72 61 77 2c 20 69 73 | 6e 27 74 20 64 65 73 69 |Draw, is|n't desi|
|00000cb0| 67 6e 65 64 20 66 6f 72 | 0d 76 69 73 69 6f 6e 20 |gned for|.vision |
|00000cc0| 65 78 70 65 72 69 6d 65 | 6e 74 73 2e 20 54 68 65 |experime|nts. The|
|00000cd0| 20 66 61 63 69 6c 69 74 | 69 65 73 20 66 6f 72 20 | facilit|ies for |
|00000ce0| 63 72 65 61 74 69 6e 67 | 20 69 6d 61 67 65 73 20 |creating| images |
|00000cf0| 61 72 65 20 66 69 6e 65 | 2c 20 62 75 74 20 74 68 |are fine|, but th|
|00000d00| 65 20 63 6f 6e 74 72 6f | 6c 0d 6f 66 20 74 68 65 |e contro|l.of the|
|00000d10| 20 43 4c 55 54 73 20 70 | 72 6f 76 69 64 65 64 20 | CLUTs p|rovided |
|00000d20| 62 79 20 74 68 65 20 50 | 61 6c 65 74 74 65 20 61 |by the P|alette a|
|00000d30| 6e 64 20 43 6f 6c 6f 72 | 20 4d 61 6e 61 67 65 72 |nd Color| Manager|
|00000d40| 73 20 69 73 20 75 6e 73 | 61 74 69 73 66 61 63 74 |s is uns|atisfact|
|00000d50| 6f 72 79 20 66 6f 72 0d | 76 69 73 69 6f 6e 20 72 |ory for.|vision r|
|00000d60| 65 73 65 61 72 63 68 20 | 62 65 63 61 75 73 65 20 |esearch |because |
|00000d70| 61 20 6c 6f 74 20 68 61 | 70 70 65 6e 73 20 62 65 |a lot ha|ppens be|
|00000d80| 68 69 6e 64 20 79 6f 75 | 72 20 62 61 63 6b 2e 20 |hind you|r back. |
|00000d90| 49 6e 20 70 61 72 74 69 | 63 75 6c 61 72 20 74 68 |In parti|cular th|
|00000da0| 65 0d 50 61 6c 65 74 74 | 65 20 4d 61 6e 61 67 65 |e.Palett|e Manage|
|00000db0| 72 20 6c 69 6b 65 73 20 | 74 6f 20 6d 61 69 6e 74 |r likes |to maint|
|00000dc0| 61 69 6e 20 61 20 63 6f | 6e 73 69 73 74 65 6e 74 |ain a co|nsistent|
|00000dd0| 20 63 6f 6c 6f 72 20 65 | 6e 76 69 72 6f 6e 6d 65 | color e|nvironme|
|00000de0| 6e 74 20 61 63 72 6f 73 | 73 20 74 68 65 0d 65 6e |nt acros|s the.en|
|00000df0| 74 69 72 65 20 64 65 73 | 6b 74 6f 70 2c 20 77 68 |tire des|ktop, wh|
|00000e00| 69 63 68 20 69 6e 63 6c | 75 64 65 73 20 61 6c 6c |ich incl|udes all|
|00000e10| 20 79 6f 75 72 20 73 63 | 72 65 65 6e 73 2e 20 57 | your sc|reens. W|
|00000e20| 65 6c 6c 2c 20 69 6e 20 | 76 69 73 69 6f 6e 20 65 |ell, in |vision e|
|00000e30| 78 70 65 72 69 6d 65 6e | 74 73 20 77 65 0d 67 65 |xperimen|ts we.ge|
|00000e40| 6e 65 72 61 6c 6c 79 20 | 77 61 6e 74 20 74 6f 20 |nerally |want to |
|00000e50| 74 72 65 61 74 20 65 61 | 63 68 20 73 63 72 65 65 |treat ea|ch scree|
|00000e60| 6e 20 61 73 20 61 20 74 | 6f 74 61 6c 6c 79 20 73 |n as a t|otally s|
|00000e70| 65 70 61 72 61 74 65 20 | 64 65 76 69 63 65 2c 20 |eparate |device, |
|00000e80| 75 6e 61 66 66 65 63 74 | 65 64 20 62 79 0d 77 68 |unaffect|ed by.wh|
|00000e90| 61 74 20 77 65 20 64 6f | 20 74 6f 20 74 68 65 20 |at we do| to the |
|00000ea0| 6f 74 68 65 72 20 73 63 | 72 65 65 6e 73 2e 20 54 |other sc|reens. T|
|00000eb0| 68 69 73 20 69 73 20 73 | 6f 6c 76 65 64 20 62 79 |his is s|olved by|
|00000ec0| 20 74 68 65 20 72 6f 75 | 74 69 6e 65 20 47 44 53 | the rou|tine GDS|
|00000ed0| 65 74 45 6e 74 72 69 65 | 73 28 29 0d 77 68 69 63 |etEntrie|s().whic|
|00000ee0| 68 20 6d 61 6b 65 73 20 | 61 20 6c 6f 77 2d 6c 65 |h makes |a low-le|
|00000ef0| 76 65 6c 20 63 61 6c 6c | 20 74 6f 20 74 68 65 20 |vel call| to the |
|00000f00| 76 69 64 65 6f 20 64 72 | 69 76 65 72 20 74 6f 20 |video dr|iver to |
|00000f10| 63 68 61 6e 67 65 20 74 | 68 65 20 43 4c 55 54 20 |change t|he CLUT |
|00000f20| 64 69 72 65 63 74 6c 79 | 0d 77 69 74 68 6f 75 74 |directly|.without|
|00000f30| 20 51 75 69 63 6b 44 72 | 61 77 27 73 20 6b 6e 6f | QuickDr|aw's kno|
|00000f40| 77 6c 65 64 67 65 2e 20 | 28 54 68 69 73 20 77 69 |wledge. |(This wi|
|00000f50| 6c 6c 20 77 6f 72 6b 20 | 77 69 74 68 20 61 6e 79 |ll work |with any|
|00000f60| 20 76 69 64 65 6f 20 63 | 61 72 64 20 74 68 61 74 | video c|ard that|
|00000f70| 20 77 6f 72 6b 73 0d 77 | 69 74 68 20 74 68 65 20 | works.w|ith the |
|00000f80| 4d 61 63 20 49 49 2e 29 | 20 54 68 65 20 72 6f 75 |Mac II.)| The rou|
|00000f90| 74 69 6e 65 20 4c 6f 61 | 64 4c 75 6d 69 6e 61 6e |tine Loa|dLuminan|
|00000fa0| 63 65 73 28 29 2c 20 77 | 68 69 63 68 20 69 73 20 |ces(), w|hich is |
|00000fb0| 75 73 65 64 20 62 65 6c | 6f 77 2c 20 69 73 20 6a |used bel|ow, is j|
|00000fc0| 75 73 74 20 61 0d 63 6f | 6e 76 65 6e 69 65 6e 74 |ust a.co|nvenient|
|00000fd0| 20 67 6c 75 65 20 72 6f | 75 74 69 6e 65 20 66 6f | glue ro|utine fo|
|00000fe0| 72 20 63 61 6c 6c 69 6e | 67 20 47 44 53 65 74 45 |r callin|g GDSetE|
|00000ff0| 6e 74 72 69 65 73 28 29 | 2e 0d 35 2e 20 41 70 70 |ntries()|..5. App|
|00001000| 6c 65 20 73 70 65 63 69 | 66 69 65 73 20 74 68 61 |le speci|fies tha|
|00001010| 74 20 74 68 65 20 76 69 | 64 65 6f 20 64 72 69 76 |t the vi|deo driv|
|00001020| 65 72 20 73 68 6f 75 6c | 64 20 73 69 6c 65 6e 74 |er shoul|d silent|
|00001030| 6c 79 20 69 6d 70 6c 65 | 6d 65 6e 74 20 67 61 6d |ly imple|ment gam|
|00001040| 6d 61 0d 63 6f 72 72 65 | 63 74 69 6f 6e 20 74 6f |ma.corre|ction to|
|00001050| 20 61 74 74 65 6d 70 74 | 20 74 6f 20 63 6f 72 72 | attempt| to corr|
|00001060| 65 63 74 20 66 6f 72 20 | 74 68 65 20 64 69 73 70 |ect for |the disp|
|00001070| 6c 61 79 27 73 20 6e 6f | 6e 6c 69 6e 65 61 72 20 |lay's no|nlinear |
|00001080| 72 65 6c 61 74 69 6f 6e | 20 62 65 74 77 65 65 6e |relation| between|
|00001090| 0d 6c 75 6d 69 6e 61 6e | 63 65 20 61 6e 64 20 69 |.luminan|ce and i|
|000010a0| 6e 70 75 74 20 76 6f 6c | 74 61 67 65 2e 20 57 65 |nput vol|tage. We|
|000010b0| 20 64 6f 6e 27 74 20 77 | 61 6e 74 20 74 68 69 73 | don't w|ant this|
|000010c0| 20 62 65 63 61 75 73 65 | 20 74 68 69 73 20 68 69 | because| this hi|
|000010d0| 64 64 65 6e 20 67 61 6d | 6d 61 0d 63 6f 72 72 65 |dden gam|ma.corre|
|000010e0| 63 74 69 6f 6e 20 6c 6f | 73 65 73 20 70 72 65 63 |ction lo|ses prec|
|000010f0| 69 73 69 6f 6e 20 61 6e | 64 20 69 6e 74 65 72 66 |ision an|d interf|
|00001100| 65 72 65 73 20 77 69 74 | 68 20 74 68 65 20 6f 70 |eres wit|h the op|
|00001110| 65 72 61 74 69 6f 6e 20 | 6f 66 20 74 68 65 20 49 |eration |of the I|
|00001120| 53 52 20 56 69 64 65 6f | 0d 41 74 74 65 6e 75 61 |SR Video|.Attenua|
|00001130| 74 6f 72 2c 20 77 68 69 | 63 68 20 77 69 6c 6c 20 |tor, whi|ch will |
|00001140| 73 65 65 6d 20 74 6f 20 | 6f 70 65 72 61 74 65 20 |seem to |operate |
|00001150| 4e 4f 4e 6c 69 6e 65 61 | 72 6c 79 20 69 66 20 74 |NONlinea|rly if t|
|00001160| 68 69 73 20 67 61 6d 6d | 61 20 63 6f 72 72 65 63 |his gamm|a correc|
|00001170| 74 69 6f 6e 0d 74 61 6b | 65 73 20 70 6c 61 63 65 |tion.tak|es place|
|00001180| 20 75 6e 62 65 6b 6e 6f | 77 6e 73 74 20 74 6f 20 | unbekno|wnst to |
|00001190| 75 73 2e 20 54 68 69 73 | 20 69 73 20 73 6f 6c 76 |us. This| is solv|
|000011a0| 65 64 20 62 79 20 74 68 | 65 20 72 6f 75 74 69 6e |ed by th|e routin|
|000011b0| 65 20 47 44 4c 69 6e 65 | 61 72 47 61 6d 6d 61 28 |e GDLine|arGamma(|
|000011c0| 29 0d 77 68 69 63 68 20 | 6d 61 6b 65 73 20 61 20 |).which |makes a |
|000011d0| 6c 6f 77 2d 6c 65 76 65 | 6c 20 63 61 6c 6c 20 74 |low-leve|l call t|
|000011e0| 6f 20 74 68 65 20 76 69 | 64 65 6f 20 64 72 69 76 |o the vi|deo driv|
|000011f0| 65 72 20 61 6e 64 20 6c | 6f 61 64 73 20 61 20 6c |er and l|oads a l|
|00001200| 69 6e 65 61 72 20 67 61 | 6d 6d 61 20 74 61 62 6c |inear ga|mma tabl|
|00001210| 65 2c 0d 69 2e 65 2e 20 | 6e 6f 20 63 6f 72 72 65 |e,.i.e. |no corre|
|00001220| 63 74 69 6f 6e 2e 0d 0d | 53 55 4d 4d 41 52 59 3a |ction...|SUMMARY:|
|00001230| 0d 0d 64 6f 75 62 6c 65 | 20 45 54 6f 4c 28 4c 75 |..double| EToL(Lu|
|00001240| 6d 69 6e 61 6e 63 65 52 | 65 63 6f 72 64 20 2a 4c |minanceR|ecord *L|
|00001250| 50 2c 69 6e 74 20 65 6e | 74 72 79 29 3b 0d 52 65 |P,int en|try);.Re|
|00001260| 74 75 72 6e 73 20 74 68 | 65 20 6c 75 6d 69 6e 61 |turns th|e lumina|
|00001270| 6e 63 65 20 61 73 73 6f | 63 69 61 74 65 64 20 77 |nce asso|ciated w|
|00001280| 69 74 68 20 74 68 65 20 | 70 61 72 74 69 63 75 6c |ith the |particul|
|00001290| 61 72 20 65 6e 74 72 79 | 2e 0d 0d 69 6e 74 20 4c |ar entry|...int L|
|000012a0| 54 6f 45 28 4c 75 6d 69 | 6e 61 6e 63 65 52 65 63 |ToE(Lumi|nanceRec|
|000012b0| 6f 72 64 20 2a 4c 50 2c | 64 6f 75 62 6c 65 20 4c |ord *LP,|double L|
|000012c0| 2c 69 6e 74 20 66 69 72 | 73 74 45 6e 74 72 79 2c |,int fir|stEntry,|
|000012d0| 69 6e 74 20 6c 61 73 74 | 45 6e 74 72 79 29 3b 0d |int last|Entry);.|
|000012e0| 52 65 74 75 72 6e 73 20 | 74 68 65 20 69 6e 64 65 |Returns |the inde|
|000012f0| 78 20 6f 66 20 74 68 65 | 20 74 61 62 6c 65 20 65 |x of the| table e|
|00001300| 6e 74 72 79 20 69 6e 20 | 73 70 65 63 69 66 69 65 |ntry in |specifie|
|00001310| 64 20 72 61 6e 67 65 20 | 77 69 74 68 20 6c 75 6d |d range |with lum|
|00001320| 69 6e 61 6e 63 65 20 63 | 6c 6f 73 65 73 74 20 74 |inance c|losest t|
|00001330| 6f 20 4c 2e 0d 0d 69 6e | 74 20 4c 74 6f 45 4f 72 |o L...in|t LtoEOr|
|00001340| 64 65 72 65 64 28 4c 75 | 6d 69 6e 61 6e 63 65 52 |dered(Lu|minanceR|
|00001350| 65 63 6f 72 64 20 2a 4c | 50 2c 64 6f 75 62 6c 65 |ecord *L|P,double|
|00001360| 20 4c 2c 69 6e 74 20 66 | 69 72 73 74 45 6e 74 72 | L,int f|irstEntr|
|00001370| 79 2c 69 6e 74 20 6c 61 | 73 74 45 6e 74 72 79 29 |y,int la|stEntry)|
|00001380| 3b 0d 52 65 74 75 72 6e | 73 20 74 68 65 20 69 6e |;.Return|s the in|
|00001390| 64 65 78 20 6f 66 20 74 | 68 65 20 74 61 62 6c 65 |dex of t|he table|
|000013a0| 20 65 6e 74 72 79 20 69 | 6e 20 73 70 65 63 69 66 | entry i|n specif|
|000013b0| 69 65 64 20 72 61 6e 67 | 65 20 77 69 74 68 20 6c |ied rang|e with l|
|000013c0| 75 6d 69 6e 61 6e 63 65 | 20 63 6c 6f 73 65 73 74 |uminance| closest|
|000013d0| 20 74 6f 20 4c 2e 0d 52 | 75 6e 73 20 66 61 73 74 | to L..R|uns fast|
|000013e0| 20 62 79 20 61 73 73 75 | 6d 69 6e 67 20 61 6e 20 | by assu|ming an |
|000013f0| 6f 72 64 65 72 65 64 20 | 74 61 62 6c 65 20 66 72 |ordered |table fr|
|00001400| 6f 6d 20 66 69 72 73 74 | 45 6e 74 72 79 20 74 6f |om first|Entry to|
|00001410| 20 6c 61 73 74 45 6e 74 | 72 79 2c 20 65 69 74 68 | lastEnt|ry, eith|
|00001420| 65 72 20 0d 69 6e 63 72 | 65 61 73 69 6e 67 20 6f |er .incr|easing o|
|00001430| 72 20 64 65 63 72 65 61 | 73 69 6e 67 2e 0d 0d 64 |r decrea|sing...d|
|00001440| 6f 75 62 6c 65 20 53 65 | 74 4c 75 6d 69 6e 61 6e |ouble Se|tLuminan|
|00001450| 63 65 28 47 44 48 61 6e | 64 6c 65 20 64 65 76 69 |ce(GDHan|dle devi|
|00001460| 63 65 2c 4c 75 6d 69 6e | 61 6e 63 65 52 65 63 6f |ce,Lumin|anceReco|
|00001470| 72 64 20 2a 4c 50 0d 09 | 2c 69 6e 74 20 65 6e 74 |rd *LP..|,int ent|
|00001480| 72 79 2c 64 6f 75 62 6c | 65 20 6c 75 6d 69 6e 61 |ry,doubl|e lumina|
|00001490| 6e 63 65 0d 09 2c 64 6f | 75 62 6c 65 20 6c 6f 77 |nce..,do|uble low|
|000014a0| 4c 75 6d 69 6e 61 6e 63 | 65 2c 64 6f 75 62 6c 65 |Luminanc|e,double|
|000014b0| 20 68 69 67 68 4c 75 6d | 69 6e 61 6e 63 65 29 0d | highLum|inance).|
|000014c0| 53 65 74 20 6f 6e 65 20 | 65 6e 74 72 79 20 69 6e |Set one |entry in|
|000014d0| 20 74 68 65 20 43 6f 6c | 6f 72 53 70 65 63 20 74 | the Col|orSpec t|
|000014e0| 61 62 6c 65 20 28 61 6e | 64 20 74 68 65 20 43 4c |able (an|d the CL|
|000014f0| 55 54 20 69 66 20 64 65 | 76 69 63 65 20 69 73 20 |UT if de|vice is |
|00001500| 6e 6f 74 20 4e 55 4c 4c | 29 20 74 6f 0d 61 20 73 |not NULL|) to.a s|
|00001510| 70 65 63 69 66 69 65 64 | 20 6c 75 6d 69 6e 61 6e |pecified| luminan|
|00001520| 63 65 2e 20 49 74 27 73 | 20 6f 6b 20 66 6f 72 20 |ce. It's| ok for |
|00001530| 6c 6f 77 4c 75 6d 69 6e | 61 6e 63 65 20 74 6f 20 |lowLumin|ance to |
|00001540| 62 65 20 67 72 65 61 74 | 65 72 20 74 68 61 6e 20 |be great|er than |
|00001550| 68 69 67 68 4c 75 6d 69 | 6e 61 6e 63 65 2e 0d 53 |highLumi|nance..S|
|00001560| 65 74 4c 75 6d 69 6e 61 | 6e 63 65 28 29 20 73 65 |etLumina|nce() se|
|00001570| 74 73 20 61 20 73 69 6e | 67 6c 65 20 65 6e 74 72 |ts a sin|gle entr|
|00001580| 79 20 74 6f 20 74 68 65 | 20 73 70 65 63 69 66 69 |y to the| specifi|
|00001590| 65 64 20 6c 75 6d 69 6e | 61 6e 63 65 2e 20 59 6f |ed lumin|ance. Yo|
|000015a0| 75 20 6d 75 73 74 20 61 | 6c 73 6f 0d 69 6e 64 69 |u must a|lso.indi|
|000015b0| 63 61 74 65 20 74 68 65 | 20 6c 75 6d 69 6e 61 6e |cate the| luminan|
|000015c0| 63 65 20 72 61 6e 67 65 | 20 74 68 61 74 20 79 6f |ce range| that yo|
|000015d0| 75 20 61 72 65 20 77 6f | 72 6b 69 6e 67 20 6f 76 |u are wo|rking ov|
|000015e0| 65 72 2c 20 74 6f 20 61 | 6c 6c 6f 77 20 6f 70 74 |er, to a|llow opt|
|000015f0| 69 6d 61 6c 20 63 68 6f | 69 63 65 0d 6f 66 20 77 |imal cho|ice.of w|
|00001600| 68 69 63 68 20 64 61 63 | 73 20 74 6f 20 66 69 78 |hich dac|s to fix|
|00001610| 2c 20 65 74 63 2e 2c 20 | 74 6f 20 79 69 65 6c 64 |, etc., |to yield|
|00001620| 20 6d 69 6e 69 6d 75 6d | 20 65 72 72 6f 72 20 69 | minimum| error i|
|00001630| 6e 20 72 65 6c 61 74 69 | 76 65 20 6c 75 6d 69 6e |n relati|ve lumin|
|00001640| 61 6e 63 65 2e 20 0d 53 | 65 74 4c 75 6d 69 6e 61 |ance. .S|etLumina|
|00001650| 6e 63 65 73 28 29 20 64 | 6f 65 73 20 69 74 73 20 |nces() d|oes its |
|00001660| 77 6f 72 6b 20 62 79 20 | 6d 61 6b 69 6e 67 20 61 |work by |making a|
|00001670| 20 63 61 6c 6c 20 74 6f | 20 53 65 74 4c 75 6d 69 | call to| SetLumi|
|00001680| 6e 61 6e 63 65 28 29 20 | 66 6f 72 20 65 61 63 68 |nance() |for each|
|00001690| 20 65 6e 74 72 79 2e 0d | 53 65 74 4c 75 6d 69 6e | entry..|SetLumin|
|000016a0| 61 6e 63 65 20 74 61 6b | 65 73 20 31 20 6d 73 20 |ance tak|es 1 ms |
|000016b0| 74 6f 20 73 65 74 20 75 | 70 20 74 68 65 20 72 61 |to set u|p the ra|
|000016c0| 6e 67 65 20 28 62 79 20 | 63 61 6c 6c 69 6e 67 20 |nge (by |calling |
|000016d0| 53 65 74 4c 75 6d 69 6e | 61 6e 63 65 52 61 6e 67 |SetLumin|anceRang|
|000016e0| 65 29 2c 20 77 68 69 63 | 68 0d 69 74 20 6f 6e 6c |e), whic|h.it onl|
|000016f0| 79 20 68 61 73 20 74 6f | 20 64 6f 20 6f 6e 63 65 |y has to| do once|
|00001700| 2e 20 52 65 70 65 61 74 | 65 64 20 63 61 6c 6c 73 |. Repeat|ed calls|
|00001710| 20 74 6f 20 53 65 74 4c | 75 6d 69 6e 61 6e 63 65 | to SetL|uminance|
|00001720| 20 77 69 74 68 20 74 68 | 65 20 73 61 6d 65 20 72 | with th|e same r|
|00001730| 61 6e 67 65 20 77 69 6c | 6c 0d 6e 6f 74 20 63 61 |ange wil|l.not ca|
|00001740| 75 73 65 20 72 65 2d 63 | 6f 6d 70 75 74 61 74 69 |use re-c|omputati|
|00001750| 6f 6e 20 6f 66 20 74 68 | 65 20 72 61 6e 67 65 2e |on of th|e range.|
|00001760| 20 4f 6e 63 65 20 74 68 | 65 20 72 61 6e 67 65 20 | Once th|e range |
|00001770| 69 73 20 73 65 74 2c 20 | 53 65 74 4c 75 6d 69 6e |is set, |SetLumin|
|00001780| 61 6e 63 65 20 74 61 6b | 65 73 0d 61 62 6f 75 74 |ance tak|es.about|
|00001790| 20 30 2e 31 20 6d 73 2e | 20 49 66 20 53 65 74 4c | 0.1 ms.| If SetL|
|000017a0| 75 6d 69 6e 61 6e 63 65 | 20 69 73 20 74 6f 6f 20 |uminance| is too |
|000017b0| 73 6c 6f 77 20 66 6f 72 | 20 61 20 72 65 61 6c 2d |slow for| a real-|
|000017c0| 74 69 6d 65 20 61 70 70 | 6c 69 63 61 74 69 6f 6e |time app|lication|
|000017d0| 20 79 6f 75 20 63 61 6e | 20 74 65 6c 6c 0d 69 74 | you can| tell.it|
|000017e0| 20 74 6f 20 6a 75 73 74 | 20 63 6f 6d 70 75 74 65 | to just| compute|
|000017f0| 2c 20 62 75 74 20 6e 6f | 74 20 6c 6f 61 64 20 74 |, but no|t load t|
|00001800| 68 65 20 6e 65 77 20 43 | 6f 6c 6f 72 53 70 65 63 |he new C|olorSpec|
|00001810| 20 74 61 62 6c 65 20 28 | 6a 75 73 74 20 73 75 70 | table (|just sup|
|00001820| 70 6c 79 20 4e 55 4c 4c | 20 69 6e 20 70 6c 61 63 |ply NULL| in plac|
|00001830| 65 0d 6f 66 20 64 65 76 | 69 63 65 29 2c 20 61 6e |e.of dev|ice), an|
|00001840| 64 20 79 6f 75 20 63 61 | 6e 20 74 68 65 6e 20 71 |d you ca|n then q|
|00001850| 75 69 63 6b 6c 79 20 6c | 6f 61 64 20 79 6f 75 72 |uickly l|oad your|
|00001860| 20 43 6f 6c 6f 72 53 70 | 65 63 20 74 61 62 6c 65 | ColorSp|ec table|
|00001870| 20 69 6e 74 6f 20 74 68 | 65 20 43 4c 55 54 0d 6c | into th|e CLUT.l|
|00001880| 61 74 65 72 20 62 79 20 | 63 61 6c 6c 69 6e 67 20 |ater by |calling |
|00001890| 4c 6f 61 64 4c 75 6d 69 | 6e 61 6e 63 65 73 28 29 |LoadLumi|nances()|
|000018a0| 2e 0d 0d 64 6f 75 62 6c | 65 20 53 65 74 4c 75 6d |...doubl|e SetLum|
|000018b0| 69 6e 61 6e 63 65 73 41 | 6e 64 52 61 6e 67 65 28 |inancesA|ndRange(|
|000018c0| 47 44 48 61 6e 64 6c 65 | 20 64 65 76 69 63 65 2c |GDHandle| device,|
|000018d0| 4c 75 6d 69 6e 61 6e 63 | 65 52 65 63 6f 72 64 20 |Luminanc|eRecord |
|000018e0| 2a 4c 50 0d 09 2c 69 6e | 74 20 66 69 72 73 74 45 |*LP..,in|t firstE|
|000018f0| 6e 74 72 79 2c 69 6e 74 | 20 6c 61 73 74 45 6e 74 |ntry,int| lastEnt|
|00001900| 72 79 0d 09 2c 64 6f 75 | 62 6c 65 20 66 69 72 73 |ry..,dou|ble firs|
|00001910| 74 4c 75 6d 69 6e 61 6e | 63 65 2c 64 6f 75 62 6c |tLuminan|ce,doubl|
|00001920| 65 20 6c 61 73 74 4c 75 | 6d 69 6e 61 6e 63 65 0d |e lastLu|minance.|
|00001930| 09 2c 64 6f 75 62 6c 65 | 20 6c 6f 77 4c 75 6d 69 |.,double| lowLumi|
|00001940| 6e 61 6e 63 65 2c 64 6f | 75 62 6c 65 20 68 69 67 |nance,do|uble hig|
|00001950| 68 4c 75 6d 69 6e 61 6e | 63 65 29 0d 2f 2a 0d 53 |hLuminan|ce)./*.S|
|00001960| 65 74 20 61 20 73 65 72 | 69 65 73 20 6f 66 20 65 |et a ser|ies of e|
|00001970| 6e 74 72 69 65 73 20 69 | 6e 20 74 68 65 20 43 6f |ntries i|n the Co|
|00001980| 6c 6f 72 53 70 65 63 20 | 74 61 62 6c 65 20 28 61 |lorSpec |table (a|
|00001990| 6e 64 20 74 68 65 20 43 | 4c 55 54 20 69 66 20 64 |nd the C|LUT if d|
|000019a0| 65 76 69 63 65 20 69 73 | 20 6e 6f 74 20 4e 55 4c |evice is| not NUL|
|000019b0| 4c 29 0d 74 6f 20 61 20 | 6c 69 6e 65 61 72 20 73 |L).to a |linear s|
|000019c0| 65 71 75 65 6e 63 65 20 | 6f 66 20 6c 75 6d 69 6e |equence |of lumin|
|000019d0| 61 6e 63 65 73 2e 20 0d | 55 73 65 73 20 6c 61 73 |ances. .|Uses las|
|000019e0| 74 20 74 77 6f 20 61 72 | 67 75 6d 65 6e 74 73 20 |t two ar|guments |
|000019f0| 74 6f 20 73 65 74 20 74 | 68 65 20 6c 75 6d 69 6e |to set t|he lumin|
|00001a00| 61 6e 63 65 20 72 61 6e | 67 65 20 6f 66 20 69 6e |ance ran|ge of in|
|00001a10| 74 65 72 65 73 74 2e 0d | 2a 2f 0d 64 6f 75 62 6c |terest..|*/.doubl|
|00001a20| 65 20 53 65 74 4c 75 6d | 69 6e 61 6e 63 65 73 28 |e SetLum|inances(|
|00001a30| 47 44 48 61 6e 64 6c 65 | 20 64 65 76 69 63 65 2c |GDHandle| device,|
|00001a40| 4c 75 6d 69 6e 61 6e 63 | 65 52 65 63 6f 72 64 20 |Luminanc|eRecord |
|00001a50| 2a 4c 50 0d 09 2c 69 6e | 74 20 66 69 72 73 74 45 |*LP..,in|t firstE|
|00001a60| 6e 74 72 79 2c 69 6e 74 | 20 6c 61 73 74 45 6e 74 |ntry,int| lastEnt|
|00001a70| 72 79 0d 09 2c 64 6f 75 | 62 6c 65 20 66 69 72 73 |ry..,dou|ble firs|
|00001a80| 74 4c 75 6d 69 6e 61 6e | 63 65 2c 64 6f 75 62 6c |tLuminan|ce,doubl|
|00001a90| 65 20 6c 61 73 74 4c 75 | 6d 69 6e 61 6e 63 65 29 |e lastLu|minance)|
|00001aa0| 0d 2f 2a 0d 53 65 74 20 | 61 20 73 65 72 69 65 73 |./*.Set |a series|
|00001ab0| 20 6f 66 20 65 6e 74 72 | 69 65 73 20 69 6e 20 74 | of entr|ies in t|
|00001ac0| 68 65 20 43 6f 6c 6f 72 | 53 70 65 63 20 74 61 62 |he Color|Spec tab|
|00001ad0| 6c 65 20 28 61 6e 64 20 | 74 68 65 20 43 4c 55 54 |le (and |the CLUT|
|00001ae0| 20 69 66 20 64 65 76 69 | 63 65 20 69 73 20 6e 6f | if devi|ce is no|
|00001af0| 74 20 4e 55 4c 4c 29 0d | 74 6f 20 61 20 6c 69 6e |t NULL).|to a lin|
|00001b00| 65 61 72 20 73 65 71 75 | 65 6e 63 65 20 6f 66 20 |ear sequ|ence of |
|00001b10| 6c 75 6d 69 6e 61 6e 63 | 65 73 2e 20 41 73 73 75 |luminanc|es. Assu|
|00001b20| 6d 65 20 74 68 69 73 20 | 69 73 20 74 68 65 20 65 |me this |is the e|
|00001b30| 6e 74 69 72 65 20 6c 75 | 6d 69 6e 61 6e 63 65 20 |ntire lu|minance |
|00001b40| 72 61 6e 67 65 20 6f 66 | 20 0d 69 6e 74 65 72 65 |range of| .intere|
|00001b50| 73 74 2e 0d 2a 2f 0d 53 | 65 74 4c 75 6d 69 6e 61 |st..*/.S|etLumina|
|00001b60| 6e 63 65 73 28 29 20 61 | 6e 64 20 53 65 74 4c 75 |nces() a|nd SetLu|
|00001b70| 6d 69 6e 61 6e 63 65 73 | 41 6e 64 52 61 6e 67 65 |minances|AndRange|
|00001b80| 28 29 20 62 6f 74 68 20 | 70 72 6f 64 75 63 65 20 |() both |produce |
|00001b90| 61 20 6c 69 6e 65 61 72 | 20 72 65 6c 61 74 69 6f |a linear| relatio|
|00001ba0| 6e 73 68 69 70 0d 62 65 | 74 77 65 65 6e 20 43 4c |nship.be|tween CL|
|00001bb0| 55 54 20 65 6e 74 72 79 | 20 61 6e 64 20 6c 75 6d |UT entry| and lum|
|00001bc0| 69 6e 61 6e 63 65 20 6f | 76 65 72 20 74 68 65 20 |inance o|ver the |
|00001bd0| 72 61 6e 67 65 20 66 69 | 72 73 74 4c 75 6d 69 6e |range fi|rstLumin|
|00001be0| 61 6e 63 65 20 74 6f 20 | 6c 61 73 74 4c 75 6d 69 |ance to |lastLumi|
|00001bf0| 6e 61 6e 63 65 2c 0d 77 | 69 74 68 20 6d 69 6e 69 |nance,.w|ith mini|
|00001c00| 6d 75 6d 20 65 72 72 6f | 72 20 72 65 6c 61 74 69 |mum erro|r relati|
|00001c10| 76 65 20 74 6f 20 61 6e | 79 20 6c 75 6d 69 6e 61 |ve to an|y lumina|
|00001c20| 6e 63 65 20 69 6e 20 74 | 68 65 20 72 61 6e 67 65 |nce in t|he range|
|00001c30| 20 6c 6f 77 4c 75 6d 69 | 6e 61 6e 63 65 20 74 6f | lowLumi|nance to|
|00001c40| 0d 68 69 67 68 4c 75 6d | 69 6e 61 6e 63 65 2e 20 |.highLum|inance. |
|00001c50| 28 57 65 20 64 6f 6e 27 | 74 20 63 61 72 65 20 61 |(We don'|t care a|
|00001c60| 62 6f 75 74 20 61 20 73 | 6d 61 6c 6c 20 65 72 72 |bout a s|mall err|
|00001c70| 6f 72 20 69 6e 20 6d 65 | 61 6e 20 6c 75 6d 69 6e |or in me|an lumin|
|00001c80| 61 6e 63 65 2e 29 0d 28 | 53 65 74 4c 75 6d 69 6e |ance.).(|SetLumin|
|00001c90| 61 6e 63 65 73 2c 20 77 | 68 69 63 68 20 64 6f 65 |ances, w|hich doe|
|00001ca0| 73 6e 27 74 20 68 61 76 | 65 20 74 68 65 73 65 20 |sn't hav|e these |
|00001cb0| 61 72 67 75 6d 65 6e 74 | 73 2c 20 75 73 65 73 20 |argument|s, uses |
|00001cc0| 66 69 72 73 74 4c 75 6d | 69 6e 61 6e 63 65 20 61 |firstLum|inance a|
|00001cd0| 6e 64 0d 6c 61 73 74 4c | 75 6d 69 6e 61 6e 63 65 |nd.lastL|uminance|
|00001ce0| 20 74 6f 20 73 65 74 20 | 74 68 69 73 20 72 61 6e | to set |this ran|
|00001cf0| 67 65 2e 29 20 54 68 65 | 20 74 68 72 65 65 20 44 |ge.) The| three D|
|00001d00| 41 43 73 20 61 72 65 20 | 6c 69 6e 65 61 72 2c 20 |ACs are |linear, |
|00001d10| 61 6e 64 20 74 68 65 20 | 76 69 64 65 6f 0d 61 74 |and the |video.at|
|00001d20| 74 65 6e 75 61 74 6f 72 | 20 77 69 6c 6c 20 63 6f |tenuator| will co|
|00001d30| 6d 62 69 6e 65 20 74 68 | 65 6d 20 6c 69 6e 65 61 |mbine th|em linea|
|00001d40| 72 6c 79 20 79 69 65 6c | 64 69 6e 67 20 61 20 76 |rly yiel|ding a v|
|00001d50| 6f 6c 74 61 67 65 20 56 | 20 61 74 20 74 68 65 20 |oltage V| at the |
|00001d60| 64 69 73 70 6c 61 79 20 | 69 6e 70 75 74 2e 0d 54 |display |input..T|
|00001d70| 68 69 73 20 61 6c 6c 6f | 77 73 20 79 6f 75 20 74 |his allo|ws you t|
|00001d80| 6f 20 63 6f 6d 70 75 74 | 65 20 79 6f 75 72 20 69 |o comput|e your i|
|00001d90| 6d 61 67 65 20 28 65 2e | 67 2e 20 61 20 73 69 6e |mage (e.|g. a sin|
|00001da0| 65 77 61 76 65 20 67 72 | 61 74 69 6e 67 29 20 61 |ewave gr|ating) a|
|00001db0| 6e 64 20 6c 6f 61 64 65 | 64 20 74 6f 0d 74 68 65 |nd loade|d to.the|
|00001dc0| 20 66 72 61 6d 65 20 73 | 74 6f 72 65 20 61 73 20 | frame s|tore as |
|00001dd0| 61 20 66 75 6c 6c 20 73 | 63 61 6c 65 20 6c 69 6e |a full s|cale lin|
|00001de0| 65 61 72 20 66 75 6e 63 | 74 69 6f 6e 2c 20 69 2e |ear func|tion, i.|
|00001df0| 65 2e 20 77 69 74 68 20 | 76 61 6c 75 65 73 20 72 |e. with |values r|
|00001e00| 61 6e 67 69 6e 67 0d 30 | 2e 2e 32 35 35 2e 20 20 |anging.0|..255. |
|00001e10| 4c 69 6e 65 61 72 69 7a | 61 74 69 6f 6e 20 6f 66 |Lineariz|ation of|
|00001e20| 20 74 68 65 20 64 69 73 | 70 6c 61 79 20 61 6e 64 | the dis|play and|
|00001e30| 20 73 65 74 74 69 6e 67 | 20 6f 66 20 63 6f 6e 74 | setting| of cont|
|00001e40| 72 61 73 74 20 74 6f 20 | 77 68 61 74 65 76 65 72 |rast to |whatever|
|00001e50| 20 79 6f 75 0d 77 61 6e | 74 20 61 72 65 20 62 6f | you.wan|t are bo|
|00001e60| 74 68 20 61 63 63 6f 6d | 70 6c 69 73 68 65 64 20 |th accom|plished |
|00001e70| 62 79 20 6f 6e 65 20 63 | 61 6c 6c 20 74 6f 20 53 |by one c|all to S|
|00001e80| 65 74 4c 75 6d 69 6e 61 | 6e 63 65 73 28 29 2e 20 |etLumina|nces(). |
|00001e90| 54 68 65 20 63 6f 6e 74 | 72 61 73 74 20 63 61 6e |The cont|rast can|
|00001ea0| 20 62 65 0d 63 68 61 6e | 67 65 64 20 62 79 20 63 | be.chan|ged by c|
|00001eb0| 61 6c 6c 69 6e 67 20 53 | 65 74 4c 75 6d 69 6e 61 |alling S|etLumina|
|00001ec0| 6e 63 65 73 28 29 20 61 | 67 61 69 6e 2c 20 6e 6f |nces() a|gain, no|
|00001ed0| 77 20 77 69 74 68 20 61 | 20 6c 61 72 67 65 72 20 |w with a| larger |
|00001ee0| 6f 72 20 73 6d 61 6c 6c | 65 72 20 6c 75 6d 69 6e |or small|er lumin|
|00001ef0| 61 6e 63 65 0d 72 61 6e | 67 65 2e 20 49 66 20 53 |ance.ran|ge. If S|
|00001f00| 65 74 4c 75 6d 69 6e 61 | 6e 63 65 73 20 69 73 20 |etLumina|nces is |
|00001f10| 74 6f 6f 20 73 6c 6f 77 | 20 66 6f 72 20 61 20 72 |too slow| for a r|
|00001f20| 65 61 6c 2d 74 69 6d 65 | 20 61 70 70 6c 69 63 61 |eal-time| applica|
|00001f30| 74 69 6f 6e 20 28 69 74 | 73 0d 63 6f 6d 70 75 74 |tion (it|s.comput|
|00001f40| 61 74 69 6f 6e 73 20 74 | 61 6b 65 20 61 62 6f 75 |ations t|ake abou|
|00001f50| 74 20 38 2d 33 30 20 6d | 73 20 74 6f 20 63 6f 6d |t 8-30 m|s to com|
|00001f60| 70 75 74 65 20 61 20 77 | 68 6f 6c 65 20 32 35 36 |pute a w|hole 256|
|00001f70| 2d 65 6e 74 72 79 20 43 | 4c 55 54 29 20 79 6f 75 |-entry C|LUT) you|
|00001f80| 20 63 61 6e 20 74 65 6c | 6c 0d 69 74 20 74 6f 20 | can tel|l.it to |
|00001f90| 6a 75 73 74 20 63 6f 6d | 70 75 74 65 2c 20 62 75 |just com|pute, bu|
|00001fa0| 74 20 6e 6f 74 20 6c 6f | 61 64 20 74 68 65 20 6e |t not lo|ad the n|
|00001fb0| 65 77 20 43 6f 6c 6f 72 | 53 70 65 63 20 74 61 62 |ew Color|Spec tab|
|00001fc0| 6c 65 20 28 6a 75 73 74 | 20 73 75 70 70 6c 79 20 |le (just| supply |
|00001fd0| 4e 55 4c 4c 20 69 6e 0d | 70 6c 61 63 65 20 6f 66 |NULL in.|place of|
|00001fe0| 20 64 65 76 69 63 65 29 | 2c 20 61 6e 64 20 79 6f | device)|, and yo|
|00001ff0| 75 20 63 61 6e 20 74 68 | 65 6e 20 71 75 69 63 6b |u can th|en quick|
|00002000| 6c 79 20 6c 6f 61 64 20 | 79 6f 75 72 20 43 6f 6c |ly load |your Col|
|00002010| 6f 72 53 70 65 63 20 74 | 61 62 6c 65 20 69 6e 74 |orSpec t|able int|
|00002020| 6f 0d 74 68 65 20 43 4c | 55 54 20 6c 61 74 65 72 |o.the CL|UT later|
|00002030| 20 62 79 20 63 61 6c 6c | 69 6e 67 20 4c 6f 61 64 | by call|ing Load|
|00002040| 4c 75 6d 69 6e 61 6e 63 | 65 73 28 29 2e 0d 0d 64 |Luminanc|es()...d|
|00002050| 6f 75 62 6c 65 20 47 65 | 74 4c 75 6d 69 6e 61 6e |ouble Ge|tLuminan|
|00002060| 63 65 28 47 44 48 61 6e | 64 6c 65 20 64 65 76 69 |ce(GDHan|dle devi|
|00002070| 63 65 2c 4c 75 6d 69 6e | 61 6e 63 65 52 65 63 6f |ce,Lumin|anceReco|
|00002080| 72 64 20 2a 4c 50 2c 69 | 6e 74 20 65 6e 74 72 79 |rd *LP,i|nt entry|
|00002090| 29 0d 2f 2a 0d 49 66 20 | 64 65 76 69 63 65 20 69 |)./*.If |device i|
|000020a0| 73 20 6e 6f 74 20 4e 55 | 4c 4c 20 74 68 65 6e 20 |s not NU|LL then |
|000020b0| 65 78 61 6d 69 6e 65 73 | 20 6f 6e 65 20 65 6e 74 |examines| one ent|
|000020c0| 72 79 20 69 6e 20 74 68 | 65 20 61 63 74 75 61 6c |ry in th|e actual|
|000020d0| 20 43 4c 55 54 2c 20 6f | 74 68 65 72 77 69 73 65 | CLUT, o|therwise|
|000020e0| 0d 65 78 61 6d 69 6e 65 | 73 20 74 68 65 20 43 6f |.examine|s the Co|
|000020f0| 6c 6f 72 53 70 65 63 20 | 74 61 62 6c 65 20 63 6f |lorSpec |table co|
|00002100| 6e 74 61 69 6e 65 64 20 | 69 6e 20 2a 4c 50 2c 20 |ntained |in *LP, |
|00002110| 61 6e 64 20 69 6e 20 65 | 69 74 68 65 72 20 63 61 |and in e|ither ca|
|00002120| 73 65 20 72 65 74 75 72 | 6e 73 20 74 68 65 0d 6c |se retur|ns the.l|
|00002130| 75 6d 69 6e 61 6e 63 65 | 20 74 68 61 74 20 77 69 |uminance| that wi|
|00002140| 6c 6c 20 62 65 20 70 72 | 6f 64 75 63 65 64 2e 20 |ll be pr|oduced. |
|00002150| 53 75 70 70 6c 79 69 6e | 67 20 61 6e 20 69 6c 6c |Supplyin|g an ill|
|00002160| 65 67 61 6c 20 65 6e 74 | 72 79 20 76 61 6c 75 65 |egal ent|ry value|
|00002170| 20 72 65 73 75 6c 74 73 | 20 69 6e 20 61 0d 72 65 | results| in a.re|
|00002180| 74 75 72 6e 65 64 20 76 | 61 6c 75 65 20 6f 66 20 |turned v|alue of |
|00002190| 2d 49 4e 46 2e 0d 2a 2f | 0d 47 65 74 4c 75 6d 69 |-INF..*/|.GetLumi|
|000021a0| 6e 61 6e 63 65 28 29 20 | 72 65 74 75 72 6e 73 20 |nance() |returns |
|000021b0| 74 68 65 20 6c 75 6d 69 | 6e 61 6e 63 65 20 6f 66 |the lumi|nance of|
|000021c0| 20 61 20 73 69 6e 67 6c | 65 20 65 6e 74 72 79 2e | a singl|e entry.|
|000021d0| 20 49 66 20 64 65 76 69 | 63 65 20 69 73 20 6e 6f | If devi|ce is no|
|000021e0| 74 20 4e 55 4c 4c 20 74 | 68 65 6e 0d 47 65 74 4c |t NULL t|hen.GetL|
|000021f0| 75 6d 69 6e 61 6e 63 65 | 20 77 69 6c 6c 20 6d 61 |uminance| will ma|
|00002200| 6b 65 20 61 20 6c 6f 77 | 2d 6c 65 76 65 6c 20 63 |ke a low|-level c|
|00002210| 61 6c 6c 20 74 6f 20 74 | 68 65 20 76 69 64 65 6f |all to t|he video|
|00002220| 20 64 72 69 76 65 72 20 | 74 6f 20 64 65 74 65 72 | driver |to deter|
|00002230| 6d 69 6e 65 20 77 68 61 | 74 20 69 73 20 69 6e 20 |mine wha|t is in |
|00002240| 74 68 61 74 0d 43 4c 55 | 54 20 65 6e 74 72 79 20 |that.CLU|T entry |
|00002250| 69 6e 20 74 68 65 20 61 | 63 74 75 61 6c 20 68 61 |in the a|ctual ha|
|00002260| 72 64 77 61 72 65 2c 20 | 61 6e 64 20 77 69 6c 6c |rdware, |and will|
|00002270| 20 72 65 74 75 72 6e 20 | 74 68 65 20 6c 75 6d 69 | return |the lumi|
|00002280| 6e 61 6e 63 65 20 74 68 | 61 74 20 69 73 20 65 78 |nance th|at is ex|
|00002290| 70 65 63 74 65 64 0d 74 | 6f 20 72 65 73 75 6c 74 |pected.t|o result|
|000022a0| 20 67 69 76 65 6e 20 74 | 68 65 20 63 68 61 6e 6e | given t|he chann|
|000022b0| 65 6c 20 67 61 69 6e 73 | 20 61 6e 64 20 6c 75 6d |el gains| and lum|
|000022c0| 69 6e 61 6e 63 65 20 6e | 6f 6e 6c 69 6e 65 61 72 |inance n|onlinear|
|000022d0| 69 74 79 20 64 65 73 63 | 72 69 62 65 64 20 69 6e |ity desc|ribed in|
|000022e0| 20 79 6f 75 72 0d 4c 75 | 6d 69 6e 61 6e 63 65 52 | your.Lu|minanceR|
|000022f0| 65 63 6f 72 64 2e 20 49 | 66 20 64 65 76 69 63 65 |ecord. I|f device|
|00002300| 20 69 73 20 4e 55 4c 4c | 20 74 68 65 6e 20 47 65 | is NULL| then Ge|
|00002310| 74 4c 75 6d 69 6e 61 6e | 63 65 0d 72 65 74 75 72 |tLuminan|ce.retur|
|00002320| 6e 73 20 74 68 65 20 6c | 75 6d 69 6e 61 6e 63 65 |ns the l|uminance|
|00002330| 20 63 6f 72 72 65 73 70 | 6f 6e 64 69 6e 67 20 74 | corresp|onding t|
|00002340| 6f 20 74 68 65 20 65 6e | 74 72 79 20 69 6e 20 74 |o the en|try in t|
|00002350| 68 65 20 43 6f 6c 6f 72 | 53 70 65 63 20 74 61 62 |he Color|Spec tab|
|00002360| 6c 65 20 69 6e 20 79 6f | 75 72 0d 4c 75 6d 69 6e |le in yo|ur.Lumin|
|00002370| 61 6e 63 65 52 65 63 6f | 72 64 2e 0d 0d 76 6f 69 |anceReco|rd...voi|
|00002380| 64 20 49 6e 63 72 65 6d | 65 6e 74 4c 75 6d 69 6e |d Increm|entLumin|
|00002390| 61 6e 63 65 28 47 44 48 | 61 6e 64 6c 65 20 64 65 |ance(GDH|andle de|
|000023a0| 76 69 63 65 2c 4c 75 6d | 69 6e 61 6e 63 65 52 65 |vice,Lum|inanceRe|
|000023b0| 63 6f 72 64 20 2a 4c 50 | 2c 69 6e 74 20 65 6e 74 |cord *LP|,int ent|
|000023c0| 72 79 29 0d 2f 2a 0d 4d | 61 6b 65 20 73 6d 61 6c |ry)./*.M|ake smal|
|000023d0| 6c 65 73 74 20 70 6f 73 | 73 69 62 6c 65 20 69 6e |lest pos|sible in|
|000023e0| 63 72 65 61 73 65 20 6f | 66 20 74 68 65 20 6c 75 |crease o|f the lu|
|000023f0| 6d 69 6e 61 6e 63 65 20 | 6f 66 20 6f 6e 65 20 65 |minance |of one e|
|00002400| 6e 74 72 79 20 69 6e 20 | 74 68 65 20 43 6f 6c 6f |ntry in |the Colo|
|00002410| 72 53 70 65 63 20 74 61 | 62 6c 65 2e 0d 54 68 69 |rSpec ta|ble..Thi|
|00002420| 73 20 69 73 20 61 20 77 | 61 79 20 74 6f 20 66 69 |s is a w|ay to fi|
|00002430| 67 75 72 65 20 6f 75 74 | 20 77 68 61 74 20 69 73 |gure out| what is|
|00002440| 20 74 68 65 20 6c 6f 77 | 65 73 74 20 63 6f 6e 74 | the low|est cont|
|00002450| 72 61 73 74 20 74 68 61 | 74 20 79 6f 75 20 63 61 |rast tha|t you ca|
|00002460| 6e 20 70 72 6f 64 75 63 | 65 2e 0d 2a 2f 0d 0d 76 |n produc|e..*/..v|
|00002470| 6f 69 64 20 4c 6f 61 64 | 4c 75 6d 69 6e 61 6e 63 |oid Load|Luminanc|
|00002480| 65 73 28 47 44 48 61 6e | 64 6c 65 20 64 65 76 69 |es(GDHan|dle devi|
|00002490| 63 65 2c 20 4c 75 6d 69 | 6e 61 6e 63 65 52 65 63 |ce, Lumi|nanceRec|
|000024a0| 6f 72 64 20 2a 4c 50 2c | 0d 09 69 6e 74 20 66 69 |ord *LP,|..int fi|
|000024b0| 72 73 74 45 6e 74 72 79 | 2c 20 69 6e 74 20 6c 61 |rstEntry|, int la|
|000024c0| 73 74 45 6e 74 72 79 29 | 0d 2f 2a 0d 54 68 69 73 |stEntry)|./*.This|
|000024d0| 20 6a 75 73 74 20 63 61 | 6c 6c 73 20 47 44 53 65 | just ca|lls GDSe|
|000024e0| 74 45 6e 74 72 69 65 73 | 28 29 20 74 6f 20 6c 6f |tEntries|() to lo|
|000024f0| 61 64 20 79 6f 75 72 20 | 43 6f 6c 6f 72 53 70 65 |ad your |ColorSpe|
|00002500| 63 20 74 61 62 6c 65 20 | 69 6e 74 6f 20 74 68 65 |c table |into the|
|00002510| 20 43 4c 55 54 20 6f 66 | 0d 79 6f 75 72 20 73 63 | CLUT of|.your sc|
|00002520| 72 65 65 6e 20 64 65 76 | 69 63 65 2e 20 49 74 20 |reen dev|ice. It |
|00002530| 69 73 20 68 65 72 65 20 | 73 69 6d 70 6c 79 20 74 |is here |simply t|
|00002540| 6f 20 70 72 6f 76 69 64 | 65 20 61 20 63 6f 73 6d |o provid|e a cosm|
|00002550| 65 74 69 63 20 6d 61 74 | 63 68 20 74 6f 20 74 68 |etic mat|ch to th|
|00002560| 65 0d 63 61 6c 6c 20 74 | 6f 20 53 65 74 4c 75 6d |e.call t|o SetLum|
|00002570| 69 6e 61 6e 63 65 73 28 | 29 2c 20 66 6f 72 20 77 |inances(|), for w|
|00002580| 68 69 63 68 20 6c 6f 61 | 64 69 6e 67 20 74 68 65 |hich loa|ding the|
|00002590| 20 43 4c 55 54 20 69 73 | 20 6f 70 74 69 6f 6e 61 | CLUT is| optiona|
|000025a0| 6c 2e 0d 4e 6f 74 65 3a | 20 69 66 20 79 6f 75 20 |l..Note:| if you |
|000025b0| 70 72 65 66 65 72 2c 20 | 69 6e 73 74 65 61 64 20 |prefer, |instead |
|000025c0| 6f 66 20 4c 50 20 79 6f | 75 20 6d 61 79 20 73 65 |of LP yo|u may se|
|000025d0| 6e 64 20 6a 75 73 74 20 | 74 68 65 20 61 64 64 72 |nd just |the addr|
|000025e0| 65 73 73 20 6f 66 20 0d | 61 20 43 6f 6c 6f 72 53 |ess of .|a ColorS|
|000025f0| 70 65 63 20 74 61 62 6c | 65 2c 20 63 61 73 74 20 |pec tabl|e, cast |
|00002600| 74 6f 20 28 4c 75 6d 69 | 6e 61 6e 63 65 52 65 63 |to (Lumi|nanceRec|
|00002610| 6f 72 64 20 2a 29 2c 20 | 73 69 6e 63 65 20 61 20 |ord *), |since a |
|00002620| 4c 75 6d 69 6e 61 6e 63 | 65 52 65 63 6f 72 64 20 |Luminanc|eRecord |
|00002630| 0d 62 65 67 69 6e 73 20 | 77 69 74 68 20 61 20 43 |.begins |with a C|
|00002640| 6f 6c 6f 72 53 70 65 63 | 20 74 61 62 6c 65 2e 0d |olorSpec| table..|
|00002650| 44 6f 65 73 20 6e 6f 74 | 68 69 6e 67 20 69 66 20 |Does not|hing if |
|00002660| 64 65 76 69 63 65 3d 3d | 4e 55 4c 4c 20 6f 72 20 |device==|NULL or |
|00002670| 74 68 65 20 64 65 76 69 | 63 65 20 68 61 73 20 6e |the devi|ce has n|
|00002680| 6f 20 64 72 69 76 65 72 | 2e 0d 2a 2f 0d 0d 64 6f |o driver|..*/..do|
|00002690| 75 62 6c 65 20 47 65 74 | 56 28 47 44 48 61 6e 64 |uble Get|V(GDHand|
|000026a0| 6c 65 20 64 65 76 69 63 | 65 2c 4c 75 6d 69 6e 61 |le devic|e,Lumina|
|000026b0| 6e 63 65 52 65 63 6f 72 | 64 20 2a 4c 50 2c 69 6e |nceRecor|d *LP,in|
|000026c0| 74 20 65 6e 74 72 79 29 | 3b 0d 64 6f 75 62 6c 65 |t entry)|;.double|
|000026d0| 20 56 54 6f 4c 28 4c 75 | 6d 69 6e 61 6e 63 65 52 | VToL(Lu|minanceR|
|000026e0| 65 63 6f 72 64 20 2a 4c | 50 2c 64 6f 75 62 6c 65 |ecord *L|P,double|
|000026f0| 20 56 29 3b 0d 64 6f 75 | 62 6c 65 20 4c 54 6f 56 | V);.dou|ble LToV|
|00002700| 28 4c 75 6d 69 6e 61 6e | 63 65 52 65 63 6f 72 64 |(Luminan|ceRecord|
|00002710| 20 2a 4c 50 2c 64 6f 75 | 62 6c 65 20 4c 29 3b 0d | *LP,dou|ble L);.|
|00002720| 64 6f 75 62 6c 65 20 4c | 54 6f 4c 28 4c 75 6d 69 |double L|ToL(Lumi|
|00002730| 6e 61 6e 63 65 52 65 63 | 6f 72 64 20 2a 4c 50 2c |nanceRec|ord *LP,|
|00002740| 64 6f 75 62 6c 65 20 4c | 29 3b 0d 4d 6f 73 74 20 |double L|);.Most |
|00002750| 75 73 65 72 73 20 77 69 | 6c 6c 20 6e 65 76 65 72 |users wi|ll never|
|00002760| 20 68 61 76 65 20 61 6e | 79 20 72 65 61 73 6f 6e | have an|y reason|
|00002770| 20 74 6f 20 75 73 65 20 | 74 68 65 73 65 20 72 6f | to use |these ro|
|00002780| 75 74 69 6e 65 73 2e 20 | 54 68 65 79 20 61 72 65 |utines. |They are|
|00002790| 20 75 73 65 66 75 6c 0d | 70 72 69 6d 61 72 69 6c | useful.|primaril|
|000027a0| 79 20 69 6e 20 65 72 72 | 6f 72 20 61 6e 61 6c 79 |y in err|or analy|
|000027b0| 73 69 73 20 6f 66 20 74 | 68 65 20 4c 75 6d 69 6e |sis of t|he Lumin|
|000027c0| 61 6e 63 65 2e 63 20 70 | 61 63 6b 61 67 65 2e 0d |ance.c p|ackage..|
|000027d0| 0d 45 58 41 4d 50 4c 45 | 53 3a 0d 0d 64 6f 75 62 |.EXAMPLE|S:..doub|
|000027e0| 6c 65 20 74 6f 6c 65 72 | 61 6e 63 65 2c 6c 75 6d |le toler|ance,lum|
|000027f0| 69 6e 61 6e 63 65 2c 6d | 65 61 6e 4c 75 6d 69 6e |inance,m|eanLumin|
|00002800| 61 6e 63 65 2c 63 3b 0d | 69 6e 74 20 66 69 72 73 |ance,c;.|int firs|
|00002810| 74 45 6e 74 72 79 2c 6c | 61 73 74 45 6e 74 72 79 |tEntry,l|astEntry|
|00002820| 2c 65 6e 74 72 79 3b 0d | 0d 2f 2a 20 6c 6f 61 64 |,entry;.|./* load|
|00002830| 20 43 4c 55 54 20 77 69 | 74 68 20 6c 69 6e 65 61 | CLUT wi|th linea|
|00002840| 72 20 6c 75 6d 69 6e 61 | 6e 63 65 20 72 61 6e 67 |r lumina|nce rang|
|00002850| 65 2c 20 69 6d 6d 65 64 | 69 61 74 65 6c 79 20 2a |e, immed|iately *|
|00002860| 2f 0d 74 6f 6c 65 72 61 | 6e 63 65 3d 53 65 74 4c |/.tolera|nce=SetL|
|00002870| 75 6d 69 6e 61 6e 63 65 | 73 28 64 65 76 69 63 65 |uminance|s(device|
|00002880| 2c 26 4c 52 2c 30 2c 32 | 35 35 2c 28 31 2e 2d 63 |,&LR,0,2|55,(1.-c|
|00002890| 29 2a 6d 65 61 6e 4c 75 | 6d 69 6e 61 6e 63 65 2c |)*meanLu|minance,|
|000028a0| 28 31 2b 63 29 2a 6d 65 | 61 6e 4c 75 6d 69 6e 61 |(1+c)*me|anLumina|
|000028b0| 6e 63 65 29 3b 0d 0d 2f | 2a 20 6c 6f 61 64 20 43 |nce);../|* load C|
|000028c0| 6f 6c 6f 72 53 70 65 63 | 20 74 61 62 6c 65 20 77 |olorSpec| table w|
|000028d0| 69 74 68 20 6c 69 6e 65 | 61 72 20 6c 75 6d 69 6e |ith line|ar lumin|
|000028e0| 61 6e 63 65 20 72 61 6e | 67 65 2c 20 74 68 65 6e |ance ran|ge, then|
|000028f0| 20 6c 6f 61 64 20 43 4c | 55 54 20 2a 2f 0d 74 6f | load CL|UT */.to|
|00002900| 6c 65 72 61 6e 63 65 3d | 53 65 74 4c 75 6d 69 6e |lerance=|SetLumin|
|00002910| 61 6e 63 65 73 28 4e 55 | 4c 4c 2c 26 4c 52 2c 30 |ances(NU|LL,&LR,0|
|00002920| 2c 32 35 35 2c 28 31 2e | 2d 63 29 2a 6d 65 61 6e |,255,(1.|-c)*mean|
|00002930| 4c 75 6d 69 6e 61 6e 63 | 65 2c 28 31 2b 63 29 2a |Luminanc|e,(1+c)*|
|00002940| 6d 65 61 6e 4c 75 6d 69 | 6e 61 6e 63 65 29 3b 0d |meanLumi|nance);.|
|00002950| 4c 6f 61 64 4c 75 6d 69 | 6e 61 6e 63 65 73 28 64 |LoadLumi|nances(d|
|00002960| 65 76 69 63 65 2c 26 4c | 52 2c 66 69 72 73 74 45 |evice,&L|R,firstE|
|00002970| 6e 74 72 79 2c 6c 61 73 | 74 45 6e 74 72 79 29 3b |ntry,las|tEntry);|
|00002980| 0d 0d 2f 2a 20 6c 6f 61 | 64 20 43 6f 6c 6f 72 53 |../* loa|d ColorS|
|00002990| 70 65 63 20 74 61 62 6c | 65 20 77 69 74 68 20 73 |pec tabl|e with s|
|000029a0| 69 6e 75 73 6f 69 64 61 | 6c 20 6c 75 6d 69 6e 61 |inusoida|l lumina|
|000029b0| 6e 63 65 20 72 61 6e 67 | 65 2c 20 74 68 65 6e 20 |nce rang|e, then |
|000029c0| 6c 6f 61 64 20 43 4c 55 | 54 20 2a 2f 0d 66 6f 72 |load CLU|T */.for|
|000029d0| 28 65 6e 74 72 79 3d 30 | 3b 65 6e 74 72 79 3c 32 |(entry=0|;entry<2|
|000029e0| 35 36 3b 65 6e 74 72 79 | 2b 2b 29 20 7b 0d 09 6c |56;entry|++) {..l|
|000029f0| 75 6d 69 6e 61 6e 63 65 | 20 3d 20 6d 65 61 6e 4c |uminance| = meanL|
|00002a00| 75 6d 69 6e 61 6e 63 65 | 2a 28 31 2e 30 2b 63 2a |uminance|*(1.0+c*|
|00002a10| 73 69 6e 28 32 2e 30 2a | 33 2e 31 34 31 35 39 32 |sin(2.0*|3.141592|
|00002a20| 36 35 2a 65 6e 74 72 79 | 2f 32 35 36 2e 29 29 3b |65*entry|/256.));|
|00002a30| 0d 09 74 6f 6c 65 72 61 | 6e 63 65 3d 53 65 74 4c |..tolera|nce=SetL|
|00002a40| 75 6d 69 6e 61 6e 63 65 | 28 4e 55 4c 4c 2c 26 4c |uminance|(NULL,&L|
|00002a50| 52 2c 65 6e 74 72 79 2c | 6c 75 6d 69 6e 61 6e 63 |R,entry,|luminanc|
|00002a60| 65 2c 28 31 2e 2d 63 29 | 2a 6d 65 61 6e 4c 75 6d |e,(1.-c)|*meanLum|
|00002a70| 69 6e 61 6e 63 65 2c 28 | 31 2b 63 29 2a 6d 65 61 |inance,(|1+c)*mea|
|00002a80| 6e 4c 75 6d 69 6e 61 6e | 63 65 29 3b 0d 7d 0d 4c |nLuminan|ce);.}.L|
|00002a90| 6f 61 64 4c 75 6d 69 6e | 61 6e 63 65 73 28 64 65 |oadLumin|ances(de|
|00002aa0| 76 69 63 65 2c 26 4c 52 | 2c 66 69 72 73 74 45 6e |vice,&LR|,firstEn|
|00002ab0| 74 72 79 2c 6c 61 73 74 | 45 6e 74 72 79 29 3b 0d |try,last|Entry);.|
|00002ac0| 0d 2f 2a 20 45 78 61 6d | 69 6e 65 20 61 6e 20 65 |./* Exam|ine an e|
|00002ad0| 6e 74 72 79 20 69 6e 20 | 74 68 65 20 43 6f 6c 6f |ntry in |the Colo|
|00002ae0| 72 53 70 65 63 20 74 61 | 62 6c 65 20 6f 72 20 43 |rSpec ta|ble or C|
|00002af0| 4c 55 54 20 2a 2f 0d 6c | 75 6d 69 6e 61 6e 63 65 |LUT */.l|uminance|
|00002b00| 3d 47 65 74 4c 75 6d 69 | 6e 61 6e 63 65 28 64 65 |=GetLumi|nance(de|
|00002b10| 76 69 63 65 2c 26 4c 52 | 2c 65 6e 74 72 79 29 3b |vice,&LR|,entry);|
|00002b20| 09 2f 2a 20 69 6e 20 43 | 4c 55 54 20 2a 2f 0d 6c |./* in C|LUT */.l|
|00002b30| 75 6d 69 6e 61 6e 63 65 | 3d 47 65 74 4c 75 6d 69 |uminance|=GetLumi|
|00002b40| 6e 61 6e 63 65 28 4e 55 | 4c 4c 2c 26 4c 52 2c 65 |nance(NU|LL,&LR,e|
|00002b50| 6e 74 72 79 29 3b 09 09 | 2f 2a 20 69 6e 20 43 6f |ntry);..|/* in Co|
|00002b60| 6c 6f 72 53 70 65 63 20 | 74 61 62 6c 65 20 2a 2f |lorSpec |table */|
|00002b70| 0d 0d 4e 4f 54 45 53 3a | 0d 0d 54 68 65 20 61 72 |..NOTES:|..The ar|
|00002b80| 67 75 6d 65 6e 74 20 66 | 69 72 73 74 45 6e 74 72 |gument f|irstEntr|
|00002b90| 79 20 6d 75 73 74 20 6e | 6f 74 20 65 78 63 65 65 |y must n|ot excee|
|00002ba0| 64 20 6c 61 73 74 45 6e | 74 72 79 2e 20 54 68 65 |d lastEn|try. The|
|00002bb0| 79 20 6d 61 79 20 62 65 | 20 65 71 75 61 6c 2e 0d |y may be| equal..|
|00002bc0| 0d 54 68 65 20 72 65 74 | 75 72 6e 65 64 20 76 61 |.The ret|urned va|
|00002bd0| 6c 75 65 2c 20 74 6f 6c | 65 72 61 6e 63 65 2c 20 |lue, tol|erance, |
|00002be0| 69 73 20 61 6e 20 65 73 | 74 69 6d 61 74 65 20 6f |is an es|timate o|
|00002bf0| 66 20 74 68 65 20 6c 61 | 72 67 65 73 74 20 70 6f |f the la|rgest po|
|00002c00| 73 73 69 62 6c 65 20 65 | 72 72 6f 72 20 69 6e 0d |ssible e|rror in.|
|00002c10| 74 68 65 20 6c 75 6d 69 | 6e 61 6e 63 65 20 44 49 |the lumi|nance DI|
|00002c20| 46 46 45 52 45 4e 43 45 | 53 2c 20 74 61 6b 69 6e |FFERENCE|S, takin|
|00002c30| 67 20 69 6e 74 6f 20 61 | 63 63 6f 75 6e 74 20 74 |g into a|ccount t|
|00002c40| 68 65 20 70 72 65 63 69 | 73 69 6f 6e 2c 20 61 63 |he preci|sion, ac|
|00002c50| 63 75 72 61 63 79 20 28 | 61 73 73 75 6d 65 64 0d |curacy (|assumed.|
|00002c60| 74 6f 20 62 65 20 b1 31 | 20 6c 65 61 73 74 20 73 |to be .1| least s|
|00002c70| 69 67 6e 69 66 69 63 61 | 6e 74 20 62 69 74 29 2c |ignifica|nt bit),|
|00002c80| 20 61 6e 64 20 72 61 6e | 67 65 20 6f 66 20 74 68 | and ran|ge of th|
|00002c90| 65 20 44 41 43 73 2e 20 | 28 4e 6f 74 65 20 74 68 |e DACs. |(Note th|
|00002ca0| 65 20 72 65 74 75 72 6e | 65 64 0d 74 6f 6c 65 72 |e return|ed.toler|
|00002cb0| 61 6e 63 65 20 74 65 6c | 6c 73 20 79 6f 75 20 61 |ance tel|ls you a|
|00002cc0| 62 6f 75 74 20 65 72 72 | 6f 72 73 20 69 6e 20 74 |bout err|ors in t|
|00002cd0| 68 65 20 6c 75 6d 69 6e | 61 6e 63 65 20 44 49 46 |he lumin|ance DIF|
|00002ce0| 46 45 52 45 4e 43 45 53 | 20 6f 6e 20 74 68 65 20 |FERENCES| on the |
|00002cf0| 64 69 73 70 6c 61 79 2e | 0d 54 68 65 20 65 72 72 |display.|.The err|
|00002d00| 6f 72 20 69 6e 20 41 42 | 53 4f 4c 55 54 45 20 6c |or in AB|SOLUTE l|
|00002d10| 75 6d 69 6e 61 6e 63 65 | 20 6f 66 20 74 68 65 20 |uminance| of the |
|00002d20| 64 69 73 70 6c 61 79 20 | 69 73 20 65 78 70 65 63 |display |is expec|
|00002d30| 74 65 64 20 74 6f 20 62 | 65 20 61 74 20 6d 6f 73 |ted to b|e at mos|
|00002d40| 74 20 b1 31 20 73 74 65 | 70 0d 6f 66 20 61 6c 6c |t .1 ste|p.of all|
|00002d50| 20 74 68 65 20 44 41 43 | 73 2c 20 69 2e 65 2e 20 | the DAC|s, i.e. |
|00002d60| 6f 6e 65 20 70 61 72 74 | 20 69 6e 20 32 35 35 20 |one part| in 255 |
|00002d70| 6f 66 20 66 75 6c 6c 20 | 73 63 61 6c 65 2e 29 0d |of full |scale.).|
|00002d80| 0d 54 68 65 72 65 20 61 | 72 65 20 6e 6f 20 72 65 |.There a|re no re|
|00002d90| 73 74 72 69 63 74 69 6f | 6e 73 20 61 74 20 61 6c |strictio|ns at al|
|00002da0| 6c 20 6f 6e 20 66 69 72 | 73 74 4c 75 6d 69 6e 61 |l on fir|stLumina|
|00002db0| 6e 63 65 20 61 6e 64 20 | 6c 61 73 74 4c 75 6d 69 |nce and |lastLumi|
|00002dc0| 6e 61 6e 63 65 2e 20 49 | 74 20 69 73 0d 72 65 61 |nance. I|t is.rea|
|00002dd0| 73 6f 6e 61 62 6c 65 20 | 74 6f 20 72 65 71 75 65 |sonable |to reque|
|00002de0| 73 74 20 61 6e 20 69 6d | 70 6f 73 73 69 62 6c 79 |st an im|possibly|
|00002df0| 20 6c 61 72 67 65 20 6c | 75 6d 69 6e 61 6e 63 65 | large l|uminance|
|00002e00| 20 72 61 6e 67 65 2c 20 | 65 2e 67 2e 20 66 72 6f | range, |e.g. fro|
|00002e10| 6d 20 61 20 6e 65 67 61 | 74 69 76 65 0d 6c 75 6d |m a nega|tive.lum|
|00002e20| 69 6e 61 6e 63 65 20 75 | 70 20 74 6f 20 74 77 69 |inance u|p to twi|
|00002e30| 63 65 20 74 68 65 20 6d | 61 78 69 6d 75 6d 20 6c |ce the m|aximum l|
|00002e40| 75 6d 69 6e 61 6e 63 65 | 2e 20 53 65 74 4c 75 6d |uminance|. SetLum|
|00002e50| 69 6e 61 6e 63 65 73 20 | 77 69 6c 6c 20 70 72 6f |inances |will pro|
|00002e60| 64 75 63 65 20 74 68 65 | 0d 63 6c 6f 73 65 73 74 |duce the|.closest|
|00002e70| 20 70 6f 73 73 69 62 6c | 65 20 61 70 70 72 6f 78 | possibl|e approx|
|00002e80| 69 6d 61 74 69 6f 6e 2e | 20 54 68 65 20 6c 75 6d |imation.| The lum|
|00002e90| 69 6e 61 6e 63 65 20 6f | 66 20 65 61 63 68 20 65 |inance o|f each e|
|00002ea0| 6e 74 72 79 20 77 69 6c | 6c 20 62 65 20 63 6c 69 |ntry wil|l be cli|
|00002eb0| 70 70 65 64 20 74 6f 0d | 66 69 74 20 69 6e 20 74 |pped to.|fit in t|
|00002ec0| 68 65 20 72 61 6e 67 65 | 20 6f 66 20 70 6f 73 73 |he range| of poss|
|00002ed0| 69 62 6c 65 20 6c 75 6d | 69 6e 61 6e 63 65 73 2e |ible lum|inances.|
|00002ee0| 20 54 68 75 73 20 79 6f | 75 20 77 69 6c 6c 20 6f | Thus yo|u will o|
|00002ef0| 62 74 61 69 6e 20 74 68 | 65 20 72 65 71 75 65 73 |btain th|e reques|
|00002f00| 74 65 64 0d 63 6f 6e 74 | 72 61 73 74 20 66 6f 72 |ted.cont|rast for|
|00002f10| 20 70 69 78 65 6c 20 76 | 61 6c 75 65 73 20 74 68 | pixel v|alues th|
|00002f20| 61 74 20 61 72 65 6e 27 | 74 20 63 6c 69 70 70 65 |at aren'|t clippe|
|00002f30| 64 2e 20 59 6f 75 20 63 | 61 6e 20 64 65 74 65 63 |d. You c|an detec|
|00002f40| 74 20 74 68 65 20 63 6c | 69 70 70 69 6e 67 20 62 |t the cl|ipping b|
|00002f50| 79 0d 74 68 65 20 66 61 | 63 74 20 74 68 61 74 20 |y.the fa|ct that |
|00002f60| 74 68 65 20 72 65 74 75 | 72 6e 65 64 20 74 6f 6c |the retu|rned tol|
|00002f70| 65 72 61 6e 63 65 20 77 | 69 6c 6c 20 62 65 20 76 |erance w|ill be v|
|00002f80| 65 72 79 20 6c 61 72 67 | 65 2e 0d 0d 41 20 63 6f |ery larg|e...A co|
|00002f90| 6d 6d 6f 6e 20 6d 69 73 | 74 61 6b 65 20 69 6e 20 |mmon mis|take in |
|00002fa0| 43 20 70 72 6f 67 72 61 | 6d 6d 69 6e 67 20 69 73 |C progra|mming is|
|00002fb0| 20 74 6f 20 75 73 65 20 | 61 20 70 6f 69 6e 74 65 | to use |a pointe|
|00002fc0| 72 20 74 68 61 74 20 73 | 75 70 70 6f 73 65 64 6c |r that s|upposedl|
|00002fd0| 79 20 70 6f 69 6e 74 73 | 20 74 6f 0d 61 20 73 74 |y points| to.a st|
|00002fe0| 72 75 63 74 75 72 65 2c | 20 77 69 74 68 6f 75 74 |ructure,| without|
|00002ff0| 20 65 76 65 72 20 61 6c | 6c 6f 63 61 74 69 6e 67 | ever al|locating|
|00003000| 20 73 61 69 64 20 73 74 | 72 75 63 74 75 72 65 2e | said st|ructure.|
|00003010| 20 43 6f 6e 73 69 64 65 | 72 20 74 68 65 0d 4c 75 | Conside|r the.Lu|
|00003020| 6d 69 6e 61 6e 63 65 52 | 65 63 6f 72 64 2e 20 54 |minanceR|ecord. T|
|00003030| 68 65 20 66 6f 6c 6c 6f | 77 69 6e 67 20 64 65 63 |he follo|wing dec|
|00003040| 6c 61 72 61 74 69 6f 6e | 20 61 6e 64 20 63 61 6c |laration| and cal|
|00003050| 6c 20 77 69 6c 6c 20 62 | 65 20 61 63 63 65 70 74 |l will b|e accept|
|00003060| 65 64 20 62 79 20 74 68 | 65 0d 63 6f 6d 70 69 6c |ed by th|e.compil|
|00003070| 65 72 2c 20 62 75 74 20 | 77 69 6c 6c 20 75 73 75 |er, but |will usu|
|00003080| 61 6c 6c 79 20 68 61 76 | 65 20 64 69 73 61 73 74 |ally hav|e disast|
|00003090| 72 6f 75 73 20 63 6f 6e | 73 65 71 75 65 6e 63 65 |rous con|sequence|
|000030a0| 73 3a 0d 09 4c 75 6d 69 | 6e 61 6e 63 65 52 65 63 |s:..Lumi|nanceRec|
|000030b0| 6f 72 64 20 2a 4c 50 3b | 0d 09 53 65 74 4c 75 6d |ord *LP;|..SetLum|
|000030c0| 69 6e 61 6e 63 65 73 28 | 2e 2e 2e 2c 4c 50 2c 2e |inances(|...,LP,.|
|000030d0| 2e 2e 29 3b 09 09 2f 2a | 20 42 61 64 21 20 2a 2f |..);../*| Bad! */|
|000030e0| 0d 54 68 65 20 70 72 6f | 62 6c 65 6d 20 69 73 20 |.The pro|blem is |
|000030f0| 74 68 61 74 20 79 6f 75 | 20 6e 65 76 65 72 20 61 |that you| never a|
|00003100| 6c 6c 6f 63 61 74 65 64 | 20 61 20 4c 75 6d 69 6e |llocated| a Lumin|
|00003110| 61 6e 63 65 52 65 63 6f | 72 64 2c 20 6f 6e 6c 79 |anceReco|rd, only|
|00003120| 20 61 20 70 6f 69 6e 74 | 65 72 2e 20 57 68 65 6e | a point|er. When|
|00003130| 0d 53 65 74 4c 75 6d 69 | 6e 61 6e 63 65 73 20 73 |.SetLumi|nances s|
|00003140| 74 61 72 74 73 20 73 74 | 6f 72 69 6e 67 20 69 6e |tarts st|oring in|
|00003150| 66 6f 72 6d 61 74 69 6f | 6e 20 69 6e 20 77 68 61 |formatio|n in wha|
|00003160| 74 20 69 74 20 74 68 69 | 6e 6b 73 20 69 73 20 61 |t it thi|nks is a|
|00003170| 20 4c 75 6d 69 6e 61 6e | 63 65 52 65 63 6f 72 64 | Luminan|ceRecord|
|00003180| 20 69 74 0d 77 69 6c 6c | 20 61 63 74 75 61 6c 6c | it.will| actuall|
|00003190| 79 20 62 65 20 77 72 69 | 74 69 6e 67 20 6f 76 65 |y be wri|ting ove|
|000031a0| 72 20 61 20 72 61 6e 64 | 6f 6d 20 70 61 72 74 20 |r a rand|om part |
|000031b0| 6f 66 20 6d 65 6d 6f 72 | 79 2e 20 57 68 61 74 20 |of memor|y. What |
|000031c0| 79 6f 75 20 73 68 6f 75 | 6c 64 20 64 6f 20 69 73 |you shou|ld do is|
|000031d0| 3a 0d 09 4c 75 6d 69 6e | 61 6e 63 65 52 65 63 6f |:..Lumin|anceReco|
|000031e0| 72 64 20 4c 52 3b 0d 09 | 53 65 74 4c 75 6d 69 6e |rd LR;..|SetLumin|
|000031f0| 61 6e 63 65 73 28 2e 2e | 2e 2c 26 4c 52 2c 2e 2e |ances(..|.,&LR,..|
|00003200| 2e 29 3b 09 09 2f 2a 20 | 47 6f 6f 64 20 2a 2f 0d |.);../* |Good */.|
|00003210| 4f 72 20 79 6f 75 20 63 | 61 6e 20 64 6f 20 74 68 |Or you c|an do th|
|00003220| 69 73 3a 0d 09 4c 75 6d | 69 6e 61 6e 63 65 52 65 |is:..Lum|inanceRe|
|00003230| 63 6f 72 64 20 4c 52 2c | 2a 4c 50 3b 0d 09 4c 50 |cord LR,|*LP;..LP|
|00003240| 3d 26 4c 52 3b 0d 09 53 | 65 74 4c 75 6d 69 6e 61 |=&LR;..S|etLumina|
|00003250| 6e 63 65 73 28 2e 2e 2e | 2c 4c 50 2c 2e 2e 2e 29 |nces(...|,LP,...)|
|00003260| 3b 09 09 2f 2a 20 47 6f | 6f 64 20 2a 2f 0d 54 68 |;../* Go|od */.Th|
|00003270| 69 73 20 73 65 63 6f 6e | 64 20 74 65 63 68 6e 69 |is secon|d techni|
|00003280| 71 75 65 20 69 73 20 61 | 20 62 65 74 74 65 72 20 |que is a| better |
|00003290| 68 61 62 69 74 2c 20 73 | 69 6e 63 65 20 69 66 20 |habit, s|ince if |
|000032a0| 79 6f 75 20 77 61 6e 74 | 20 74 6f 20 70 75 74 20 |you want| to put |
|000032b0| 73 6f 6d 65 20 6f 66 20 | 79 6f 75 72 20 63 6f 64 |some of |your cod|
|000032c0| 65 20 69 6e 74 6f 0d 61 | 20 73 75 62 72 6f 75 74 |e into.a| subrout|
|000032d0| 69 6e 65 2c 20 79 6f 75 | 27 6c 6c 20 62 65 20 70 |ine, you|'ll be p|
|000032e0| 61 73 73 69 6e 67 20 74 | 68 65 20 70 6f 69 6e 74 |assing t|he point|
|000032f0| 65 72 2c 20 6e 6f 74 20 | 74 68 65 20 73 74 72 75 |er, not |the stru|
|00003300| 63 74 75 72 65 20 69 74 | 73 65 6c 66 2c 20 73 6f |cture it|self, so|
|00003310| 20 79 6f 75 20 6d 69 67 | 68 74 20 61 73 20 77 65 | you mig|ht as we|
|00003320| 6c 6c 0d 67 65 74 20 75 | 73 65 64 20 74 6f 20 75 |ll.get u|sed to u|
|00003330| 73 69 6e 67 20 74 68 65 | 20 70 6f 69 6e 74 65 72 |sing the| pointer|
|00003340| 2e 0d 0d 42 65 66 6f 72 | 65 20 75 73 69 6e 67 20 |...Befor|e using |
|00003350| 53 65 74 4c 75 6d 69 6e | 61 6e 63 65 20 6f 72 20 |SetLumin|ance or |
|00003360| 53 65 74 4c 75 6d 69 6e | 61 6e 63 65 73 20 79 6f |SetLumin|ances yo|
|00003370| 75 20 6d 75 73 74 20 69 | 6e 69 74 69 61 6c 69 7a |u must i|nitializ|
|00003380| 65 20 79 6f 75 72 20 4c | 75 6d 69 6e 61 6e 63 65 |e your L|uminance|
|00003390| 52 65 63 6f 72 64 2e 20 | 0d 59 6f 75 20 73 68 6f |Record. |.You sho|
|000033a0| 75 6c 64 20 64 6f 20 74 | 68 61 74 20 62 79 20 72 |uld do t|hat by r|
|000033b0| 65 61 64 69 6e 67 20 69 | 6e 2c 0d 09 4c 75 6d 69 |eading i|n,..Lumi|
|000033c0| 6e 61 6e 63 65 52 65 63 | 6f 72 64 20 4c 52 3b 0d |nanceRec|ord LR;.|
|000033d0| 09 52 65 61 64 4c 75 6d | 69 6e 61 6e 63 65 52 65 |.ReadLum|inanceRe|
|000033e0| 63 6f 72 64 28 22 4c 75 | 6d 69 6e 61 6e 63 65 52 |cord("Lu|minanceR|
|000033f0| 65 63 6f 72 64 32 2e 68 | 22 2c 26 4c 52 2c 30 29 |ecord2.h|",&LR,0)|
|00003400| 3b 0d 6f 72 20 23 69 6e | 63 6c 75 64 69 6e 67 20 |;.or #in|cluding |
|00003410| 61 20 66 69 6c 65 20 77 | 69 74 68 20 61 6c 6c 20 |a file w|ith all |
|00003420| 74 68 65 20 70 61 72 61 | 6d 65 74 65 72 73 20 64 |the para|meters d|
|00003430| 65 73 63 72 69 62 69 6e | 67 20 79 6f 75 72 20 6d |escribin|g your m|
|00003440| 6f 6e 69 74 6f 72 2e 20 | 0d 09 4c 75 6d 69 6e 61 |onitor. |..Lumina|
|00003450| 6e 63 65 52 65 63 6f 72 | 64 20 4c 52 3b 0d 09 23 |nceRecor|d LR;..#|
|00003460| 69 6e 63 6c 75 64 65 20 | 22 4c 75 6d 69 6e 61 6e |include |"Luminan|
|00003470| 63 65 52 65 63 6f 72 64 | 32 2e 68 22 0d 0d 48 65 |ceRecord|2.h"..He|
|00003480| 72 65 27 73 20 61 6e 20 | 65 78 61 6d 70 6c 65 20 |re's an |example |
|00003490| 6f 66 20 74 68 65 20 63 | 6f 6e 74 65 6e 74 73 20 |of the c|ontents |
|000034a0| 6f 66 20 61 20 4c 75 6d | 69 6e 61 6e 63 65 52 65 |of a Lum|inanceRe|
|000034b0| 63 6f 72 64 31 2e 68 20 | 66 69 6c 65 2c 20 61 73 |cord1.h |file, as|
|000034c0| 20 70 72 6f 64 75 63 65 | 64 20 62 79 20 74 68 65 | produce|d by the|
|000034d0| 0d 70 72 6f 67 72 61 6d | 20 43 61 6c 69 62 72 61 |.program| Calibra|
|000034e0| 74 65 4c 75 6d 69 6e 61 | 6e 63 65 2e 20 59 6f 75 |teLumina|nce. You|
|000034f0| 20 6d 75 73 74 20 75 73 | 65 20 43 61 6c 69 62 72 | must us|e Calibr|
|00003500| 61 74 65 4c 75 6d 69 6e | 61 6e 63 65 20 74 6f 20 |ateLumin|ance to |
|00003510| 63 61 6c 69 62 72 61 74 | 65 0d 79 6f 75 72 20 6f |calibrat|e.your o|
|00003520| 77 6e 20 66 72 61 6d 65 | 73 74 6f 72 65 2c 20 49 |wn frame|store, I|
|00003530| 53 52 20 56 69 64 65 6f | 20 41 74 74 65 6e 75 61 |SR Video| Attenua|
|00003540| 74 6f 72 2c 20 61 6e 64 | 20 64 69 73 70 6c 61 79 |tor, and| display|
|00003550| 2e 20 0d 09 4c 52 2e 73 | 63 72 65 65 6e 3d 31 3b |. ..LR.s|creen=1;|
|00003560| 09 2f 2a 20 64 65 76 69 | 63 65 3d 47 65 74 53 63 |./* devi|ce=GetSc|
|00003570| 72 65 65 6e 44 65 76 69 | 63 65 28 4c 52 2e 73 63 |reenDevi|ce(LR.sc|
|00003580| 72 65 65 6e 29 3b 20 2a | 2f 0d 09 2f 2a 20 43 61 |reen); *|/../* Ca|
|00003590| 75 74 69 6f 6e 3a 20 74 | 68 65 20 73 63 72 65 65 |ution: t|he scree|
|000035a0| 6e 20 6e 75 6d 62 65 72 | 20 75 73 65 64 20 68 65 |n number| used he|
|000035b0| 72 65 20 61 6e 64 20 69 | 6e 20 47 65 74 53 63 72 |re and i|n GetScr|
|000035c0| 65 65 6e 20 44 65 76 69 | 63 65 20 69 73 20 4e 4f |een Devi|ce is NO|
|000035d0| 54 20 74 68 65 20 73 61 | 6d 65 20 61 73 20 2a 2f |T the sa|me as */|
|000035e0| 0d 09 2f 2a 20 64 69 73 | 70 6c 61 79 65 64 20 62 |../* dis|played b|
|000035f0| 79 20 74 68 65 20 4d 6f | 6e 69 74 6f 72 73 20 63 |y the Mo|nitors c|
|00003600| 64 65 76 20 69 6e 20 74 | 68 65 20 43 6f 6e 74 72 |dev in t|he Contr|
|00003610| 6f 6c 20 50 61 6e 65 6c | 2e 20 53 6f 72 72 79 2e |ol Panel|. Sorry.|
|00003620| 20 54 68 65 20 6d 6f 73 | 74 20 6f 62 76 69 6f 75 | The mos|t obviou|
|00003630| 73 20 64 69 66 66 65 72 | 65 6e 63 65 20 2a 2f 0d |s differ|ence */.|
|00003640| 09 2f 2a 20 69 73 20 74 | 68 61 74 20 47 65 74 53 |./* is t|hat GetS|
|00003650| 63 72 65 65 6e 44 65 76 | 69 63 65 20 61 6c 77 61 |creenDev|ice alwa|
|00003660| 79 73 20 61 73 73 69 67 | 6e 73 20 30 20 74 6f 20 |ys assig|ns 0 to |
|00003670| 74 68 65 20 6d 61 69 6e | 20 73 63 72 65 65 6e 2c |the main| screen,|
|00003680| 20 74 68 65 20 6f 6e 65 | 20 77 69 74 68 20 74 68 | the one| with th|
|00003690| 65 20 6d 65 6e 75 20 62 | 61 72 2e 20 2a 2f 0d 09 |e menu b|ar. */..|
|000036a0| 4c 52 2e 64 61 74 65 3d | 22 33 3a 30 39 20 50 4d |LR.date=|"3:09 PM|
|000036b0| 20 46 72 69 64 61 79 2c | 20 4f 63 74 6f 62 65 72 | Friday,| October|
|000036c0| 20 31 36 2c 20 31 39 39 | 32 22 3b 0d 09 4c 52 2e | 16, 199|2";..LR.|
|000036d0| 69 64 3d 22 35 31 31 31 | 37 36 37 22 3b 0d 09 4c |id="5111|767";..L|
|000036e0| 52 2e 6e 61 6d 65 3d 22 | 73 69 67 6e 61 6c 22 3b |R.name="|signal";|
|000036f0| 0d 09 4c 52 2e 6e 6f 74 | 65 73 3d 22 6d 61 6e 6f |..LR.not|es="mano|
|00003700| 6a 2c 20 6c 69 67 68 74 | 73 20 6f 66 66 2c 20 70 |j, light|s off, p|
|00003710| 68 6f 74 6f 6d 65 74 65 | 72 20 31 20 69 6e 63 68 |hotomete|r 1 inch|
|00003720| 20 66 72 6f 6d 20 73 63 | 72 65 65 6e 22 3b 0d 09 | from sc|reen";..|
|00003730| 4c 52 2e 64 70 69 3d 37 | 36 2e 30 3b 09 2f 2a 20 |LR.dpi=7|6.0;./* |
|00003740| 70 69 78 65 6c 73 20 70 | 65 72 20 69 6e 63 68 20 |pixels p|er inch |
|00003750| 2a 2f 0d 09 4c 52 2e 48 | 7a 3d 36 36 2e 36 37 3b |*/..LR.H|z=66.67;|
|00003760| 09 2f 2a 20 66 72 61 6d | 65 73 20 70 65 72 20 73 |./* fram|es per s|
|00003770| 65 63 6f 6e 64 20 2a 2f | 0d 09 4c 52 2e 75 6e 69 |econd */|..LR.uni|
|00003780| 74 73 3d 22 63 64 2f 6d | 5e 32 22 3b 0d 09 2f 2a |ts="cd/m|^2";../*|
|00003790| 20 63 6f 65 66 66 69 63 | 69 65 6e 74 73 20 6f 66 | coeffic|ients of|
|000037a0| 20 70 6f 6c 79 6e 6f 6d | 69 61 6c 20 66 69 74 20 | polynom|ial fit |
|000037b0| 2a 2f 0d 09 4c 52 2e 63 | 6f 65 66 66 69 63 69 65 |*/..LR.c|oefficie|
|000037c0| 6e 74 73 3d 39 3b 09 2f | 2a 20 23 20 6f 66 20 63 |nts=9;./|* # of c|
|000037d0| 6f 65 66 66 69 63 69 65 | 6e 74 73 20 69 6e 20 70 |oefficie|nts in p|
|000037e0| 6f 6c 79 6e 6f 6d 69 61 | 6c 20 66 69 74 20 2a 2f |olynomia|l fit */|
|000037f0| 0d 09 2f 2a 20 4c 28 56 | 29 3d 70 5b 30 5d 2b 70 |../* L(V|)=p[0]+p|
|00003800| 5b 31 5d 2a 56 2b 70 5b | 32 5d 2a 56 2a 56 2b 20 |[1]*V+p[|2]*V*V+ |
|00003810| 2e 20 2e 20 2e 20 b1 70 | 6f 6c 79 6e 6f 6d 69 61 |. . . .p|olynomia|
|00003820| 6c 45 72 72 6f 72 20 2a | 2f 0d 09 4c 52 2e 70 5b |lError *|/..LR.p[|
|00003830| 30 5d 3d 31 2e 32 38 32 | 30 31 65 2d 31 34 3b 0d |0]=1.282|01e-14;.|
|00003840| 09 4c 52 2e 70 5b 31 5d | 3d 38 2e 32 35 37 37 36 |.LR.p[1]|=8.25776|
|00003850| 65 2d 31 33 3b 0d 09 4c | 52 2e 70 5b 32 5d 3d 35 |e-13;..L|R.p[2]=5|
|00003860| 2e 30 30 30 36 34 65 2d | 31 31 3b 0d 09 4c 52 2e |.00064e-|11;..LR.|
|00003870| 70 5b 33 5d 3d 32 2e 35 | 31 31 33 38 65 2d 30 39 |p[3]=2.5|1138e-09|
|00003880| 3b 0d 09 4c 52 2e 70 5b | 34 5d 3d 37 2e 39 38 30 |;..LR.p[|4]=7.980|
|00003890| 35 35 65 2d 30 38 3b 0d | 09 4c 52 2e 70 5b 35 5d |55e-08;.|.LR.p[5]|
|000038a0| 3d 2d 32 2e 30 34 31 38 | 34 65 2d 30 39 3b 0d 09 |=-2.0418|4e-09;..|
|000038b0| 4c 52 2e 70 5b 36 5d 3d | 31 2e 37 39 31 38 31 65 |LR.p[6]=|1.79181e|
|000038c0| 2d 31 31 3b 0d 09 4c 52 | 2e 70 5b 37 5d 3d 2d 36 |-11;..LR|.p[7]=-6|
|000038d0| 2e 33 37 39 31 65 2d 31 | 34 3b 0d 09 4c 52 2e 70 |.3791e-1|4;..LR.p|
|000038e0| 5b 38 5d 3d 38 2e 31 30 | 38 38 38 65 2d 31 37 3b |[8]=8.10|888e-17;|
|000038f0| 0d 09 4c 52 2e 70 6f 6c | 79 6e 6f 6d 69 61 6c 45 |..LR.pol|ynomialE|
|00003900| 72 72 6f 72 3d 20 20 30 | 2e 32 32 36 33 3b 09 2f |rror= 0|.2263;./|
|00003910| 2a 20 52 4d 53 20 65 72 | 72 6f 72 20 6f 66 20 66 |* RMS er|ror of f|
|00003920| 69 74 20 2a 2f 0d 09 2f | 2a 20 63 6f 65 66 66 69 |it */../|* coeffi|
|00003930| 63 69 65 6e 74 73 20 6f | 66 20 71 75 61 64 72 61 |cients o|f quadra|
|00003940| 74 69 63 20 66 69 74 20 | 2a 2f 0d 09 2f 2a 20 4c |tic fit |*/../* L|
|00003950| 28 56 29 3d 71 5b 30 5d | 2b 71 5b 31 5d 2a 56 2b |(V)=q[0]|+q[1]*V+|
|00003960| 71 5b 32 5d 2a 56 2a 56 | b1 71 75 61 64 72 61 74 |q[2]*V*V|.quadrat|
|00003970| 69 63 45 72 72 6f 72 20 | 2a 2f 0d 09 4c 52 2e 71 |icError |*/..LR.q|
|00003980| 5b 30 5d 3d 34 2e 38 36 | 32 38 35 3b 0d 09 4c 52 |[0]=4.86|285;..LR|
|00003990| 2e 71 5b 31 5d 3d 2d 30 | 2e 32 30 31 32 36 36 3b |.q[1]=-0|.201266;|
|000039a0| 0d 09 4c 52 2e 71 5b 32 | 5d 3d 30 2e 30 30 31 32 |..LR.q[2|]=0.0012|
|000039b0| 35 39 39 38 3b 0d 09 4c | 52 2e 71 75 61 64 72 61 |5998;..L|R.quadra|
|000039c0| 74 69 63 45 72 72 6f 72 | 3d 20 20 32 2e 35 34 39 |ticError|= 2.549|
|000039d0| 33 3b 09 2f 2a 20 52 4d | 53 20 65 72 72 6f 72 20 |3;./* RM|S error |
|000039e0| 6f 66 20 66 69 74 20 2a | 2f 0d 09 2f 2a 20 63 6f |of fit *|/../* co|
|000039f0| 65 66 66 69 63 69 65 6e | 74 73 20 6f 66 20 70 6f |efficien|ts of po|
|00003a00| 77 65 72 20 6c 61 77 20 | 66 69 74 20 2a 2f 0d 09 |wer law |fit */..|
|00003a10| 2f 2a 20 4c 28 56 29 3d | 70 6f 77 65 72 5b 30 5d |/* L(V)=|power[0]|
|00003a20| 2b 52 65 63 74 69 66 79 | 28 70 6f 77 65 72 5b 31 |+Rectify|(power[1|
|00003a30| 5d 2b 70 6f 77 65 72 5b | 32 5d 2a 56 29 5e 70 6f |]+power[|2]*V)^po|
|00003a40| 77 65 72 5b 33 5d b1 70 | 6f 77 65 72 45 72 72 6f |wer[3].p|owerErro|
|00003a50| 72 20 2a 2f 0d 09 2f 2a | 20 77 68 65 72 65 20 52 |r */../*| where R|
|00003a60| 65 63 74 69 66 79 28 78 | 29 3d 78 20 69 66 20 78 |ectify(x|)=x if x|
|00003a70| b3 30 2c 20 61 6e 64 20 | 52 65 63 74 69 66 79 28 |.0, and |Rectify(|
|00003a80| 78 29 3d 30 20 6f 74 68 | 65 72 77 69 73 65 20 2a |x)=0 oth|erwise *|
|00003a90| 2f 0d 09 2f 2a 20 50 65 | 6c 6c 69 20 26 20 5a 68 |/../* Pe|lli & Zh|
|00003aa0| 61 6e 67 20 28 31 39 39 | 31 29 20 45 71 73 2e 39 |ang (199|1) Eqs.9|
|00003ab0| 26 31 30 20 75 73 65 20 | 73 79 6d 62 6f 6c 73 20 |&10 use |symbols |
|00003ac0| 76 3d 56 2f 32 35 35 2c | 20 61 6c 70 68 61 3d 70 |v=V/255,| alpha=p|
|00003ad0| 6f 77 65 72 5b 30 5d 2c | 20 62 65 74 61 3d 70 6f |ower[0],| beta=po|
|00003ae0| 77 65 72 5b 31 5d 2c 20 | 6b 61 70 70 61 3d 70 6f |wer[1], |kappa=po|
|00003af0| 77 65 72 5b 32 5d 2a 32 | 35 35 2c 20 67 61 6d 6d |wer[2]*2|55, gamm|
|00003b00| 61 3d 70 6f 77 65 72 5b | 33 5d 20 2a 2f 0d 09 4c |a=power[|3] */..L|
|00003b10| 52 2e 70 6f 77 65 72 5b | 30 5d 3d 2d 30 2e 30 36 |R.power[|0]=-0.06|
|00003b20| 31 35 34 32 31 3b 0d 09 | 4c 52 2e 70 6f 77 65 72 |15421;..|LR.power|
|00003b30| 5b 31 5d 3d 2d 33 2e 33 | 38 35 35 34 3b 0d 09 4c |[1]=-3.3|8554;..L|
|00003b40| 52 2e 70 6f 77 65 72 5b | 32 5d 3d 30 2e 30 33 30 |R.power[|2]=0.030|
|00003b50| 35 30 31 37 3b 0d 09 4c | 52 2e 70 6f 77 65 72 5b |5017;..L|R.power[|
|00003b60| 33 5d 3d 32 2e 34 38 38 | 36 36 3b 0d 09 4c 52 2e |3]=2.488|66;..LR.|
|00003b70| 70 6f 77 65 72 45 72 72 | 6f 72 3d 20 20 30 2e 32 |powerErr|or= 0.2|
|00003b80| 36 31 36 3b 09 2f 2a 20 | 52 4d 53 20 65 72 72 6f |616;./* |RMS erro|
|00003b90| 72 20 6f 66 20 66 69 74 | 20 2a 2f 0d 09 2f 2a 20 |r of fit| */../* |
|00003ba0| 63 6f 65 66 66 69 63 69 | 65 6e 74 73 20 6f 66 20 |coeffici|ents of |
|00003bb0| 70 6f 77 65 72 20 6c 61 | 77 20 66 69 74 2c 20 77 |power la|w fit, w|
|00003bc0| 69 74 68 20 66 69 78 65 | 64 20 65 78 70 6f 6e 65 |ith fixe|d expone|
|00003bd0| 6e 74 20 2a 2f 0d 09 2f | 2a 20 4c 28 56 29 3d 66 |nt */../|* L(V)=f|
|00003be0| 69 78 65 64 50 6f 77 65 | 72 5b 30 5d 2b 52 65 63 |ixedPowe|r[0]+Rec|
|00003bf0| 74 69 66 79 28 66 69 78 | 65 64 50 6f 77 65 72 5b |tify(fix|edPower[|
|00003c00| 31 5d 2b 66 69 78 65 64 | 50 6f 77 65 72 5b 32 5d |1]+fixed|Power[2]|
|00003c10| 2a 56 29 5e 66 69 78 65 | 64 50 6f 77 65 72 5b 33 |*V)^fixe|dPower[3|
|00003c20| 5d b1 66 69 78 65 64 50 | 6f 77 65 72 45 72 72 6f |].fixedP|owerErro|
|00003c30| 72 20 2a 2f 0d 09 4c 52 | 2e 66 69 78 65 64 50 6f |r */..LR|.fixedPo|
|00003c40| 77 65 72 5b 30 5d 3d 2d | 30 2e 37 36 34 30 35 38 |wer[0]=-|0.764058|
|00003c50| 3b 0d 09 4c 52 2e 66 69 | 78 65 64 50 6f 77 65 72 |;..LR.fi|xedPower|
|00003c60| 5b 31 5d 3d 2d 32 2e 39 | 36 37 38 35 3b 0d 09 4c |[1]=-2.9|6785;..L|
|00003c70| 52 2e 66 69 78 65 64 50 | 6f 77 65 72 5b 32 5d 3d |R.fixedP|ower[2]=|
|00003c80| 30 2e 30 33 31 30 31 36 | 34 3b 0d 09 4c 52 2e 66 |0.031016|4;..LR.f|
|00003c90| 69 78 65 64 50 6f 77 65 | 72 5b 33 5d 3d 20 20 32 |ixedPowe|r[3]= 2|
|00003ca0| 2e 32 38 3b 0d 09 4c 52 | 2e 66 69 78 65 64 50 6f |.28;..LR|.fixedPo|
|00003cb0| 77 65 72 45 72 72 6f 72 | 3d 20 20 31 2e 31 39 38 |werError|= 1.198|
|00003cc0| 36 3b 09 2f 2a 20 52 4d | 53 20 65 72 72 6f 72 20 |6;./* RM|S error |
|00003cd0| 6f 66 20 66 69 74 20 2a | 2f 0d 09 4c 52 2e 72 3d |of fit *|/..LR.r=|
|00003ce0| 30 2e 30 32 38 32 34 30 | 36 3b 0d 09 4c 52 2e 67 |0.028240|6;..LR.g|
|00003cf0| 3d 30 2e 31 34 39 38 38 | 33 3b 0d 09 4c 52 2e 62 |=0.14988|3;..LR.b|
|00003d00| 3d 30 2e 38 32 31 38 37 | 37 3b 0d 09 4c 52 2e 67 |=0.82187|7;..LR.g|
|00003d10| 61 69 6e 41 63 63 75 72 | 61 63 79 3d 2d 30 2e 30 |ainAccur|acy=-0.0|
|00003d20| 33 33 37 39 30 35 3b 0d | 09 4c 52 2e 67 6d 3d 33 |337905;.|.LR.gm=3|
|00003d30| 2e 38 35 35 34 33 3b 09 | 2f 2a 20 54 68 65 20 6d |.85543;.|/* The m|
|00003d40| 6f 6e 69 74 6f 72 27 73 | 20 63 6f 6e 74 72 61 73 |onitor's| contras|
|00003d50| 74 20 67 61 69 6e 2e 20 | 2a 2f 0d 09 4c 52 2e 56 |t gain. |*/..LR.V|
|00003d60| 4d 69 6e 3d 20 20 30 3b | 09 2f 2a 20 6d 69 6e 69 |Min= 0;|./* mini|
|00003d70| 6d 75 6d 20 76 61 6c 75 | 65 20 74 68 61 74 20 63 |mum valu|e that c|
|00003d80| 61 6e 20 62 65 20 6c 6f | 61 64 65 64 20 69 6e 74 |an be lo|aded int|
|00003d90| 6f 20 44 41 43 20 2a 2f | 0d 09 4c 52 2e 56 4d 61 |o DAC */|..LR.VMa|
|00003da0| 78 3d 32 35 35 3b 09 2f | 2a 20 6d 61 78 69 6d 75 |x=255;./|* maximu|
|00003db0| 6d 20 76 61 6c 75 65 20 | 74 68 61 74 20 63 61 6e |m value |that can|
|00003dc0| 20 62 65 20 6c 6f 61 64 | 65 64 20 69 6e 74 6f 20 | be load|ed into |
|00003dd0| 44 41 43 20 2a 2f 0d 09 | 4c 52 2e 4c 4d 69 6e 3d |DAC */..|LR.LMin=|
|00003de0| 20 20 20 2d 30 2e 30 36 | 3b 09 2f 2a 20 6c 75 6d | -0.06|;./* lum|
|00003df0| 69 6e 61 6e 63 65 20 61 | 74 20 56 4d 69 6e 20 2a |inance a|t VMin *|
|00003e00| 2f 0d 09 4c 52 2e 4c 4d | 61 78 3d 20 20 20 33 39 |/..LR.LM|ax= 39|
|00003e10| 2e 37 30 3b 09 2f 2a 20 | 6c 75 6d 69 6e 61 6e 63 |.70;./* |luminanc|
|00003e20| 65 20 61 74 20 56 4d 61 | 78 20 2a 2f 0d 09 4c 52 |e at VMa|x */..LR|
|00003e30| 2e 4c 42 61 63 6b 67 72 | 6f 75 6e 64 3d 20 20 20 |.LBackgr|ound= |
|00003e40| 39 2e 37 33 31 3b 09 2f | 2a 20 62 61 63 6b 67 72 |9.731;./|* backgr|
|00003e50| 6f 75 6e 64 20 6c 75 6d | 69 6e 61 6e 63 65 20 64 |ound lum|inance d|
|00003e60| 75 72 69 6e 67 20 63 61 | 6c 69 62 72 61 74 69 6f |uring ca|libratio|
|00003e70| 6e 20 2a 2f 0d 09 4c 52 | 2e 56 42 61 63 6b 67 72 |n */..LR|.VBackgr|
|00003e80| 6f 75 6e 64 3d 31 39 33 | 3b 09 2f 2a 20 62 61 63 |ound=193|;./* bac|
|00003e90| 6b 67 72 6f 75 6e 64 20 | 6e 75 6d 62 65 72 20 75 |kground |number u|
|00003ea0| 73 65 64 20 64 75 72 69 | 6e 67 20 63 61 6c 69 62 |sed duri|ng calib|
|00003eb0| 72 61 74 69 6f 6e 20 2a | 2f 0d 09 4c 52 2e 72 61 |ration *|/..LR.ra|
|00003ec0| 6e 67 65 53 65 74 3d 30 | 3b 09 2f 2a 20 69 6e 64 |ngeSet=0|;./* ind|
|00003ed0| 69 63 61 74 65 20 74 68 | 61 74 20 72 61 6e 67 65 |icate th|at range|
|00003ee0| 20 70 61 72 61 6d 65 74 | 65 72 73 20 68 61 76 65 | paramet|ers have|
|00003ef0| 20 79 65 74 20 74 6f 20 | 62 65 20 73 65 74 20 2a | yet to |be set *|
|00003f00| 2f 0d 09 4c 52 2e 4c 2e | 65 78 69 73 74 73 3d 30 |/..LR.L.|exists=0|
|00003f10| 3b 09 2f 2a 20 69 6e 64 | 69 63 61 74 65 20 74 68 |;./* ind|icate th|
|00003f20| 61 74 20 6c 75 6d 69 6e | 61 6e 63 65 20 74 61 62 |at lumin|ance tab|
|00003f30| 6c 65 20 68 61 73 20 79 | 65 74 20 74 6f 20 62 65 |le has y|et to be|
|00003f40| 20 69 6e 69 74 69 61 6c | 69 7a 65 64 20 2a 2f 0d | initial|ized */.|
|00003f50| 4e 6f 74 65 20 74 68 61 | 74 20 74 68 65 73 65 20 |Note tha|t these |
|00003f60| 70 61 72 61 6d 65 74 65 | 72 73 20 64 65 73 63 72 |paramete|rs descr|
|00003f70| 69 62 65 20 66 69 74 73 | 20 6f 66 20 74 68 72 65 |ibe fits| of thre|
|00003f80| 65 20 66 75 6e 63 74 69 | 6f 6e 73 20 74 6f 20 74 |e functi|ons to t|
|00003f90| 68 65 20 67 61 6d 6d 61 | 20 66 75 6e 63 74 69 6f |he gamma| functio|
|00003fa0| 6e 2e 0d 59 6f 75 20 6d | 61 79 20 6f 6d 69 74 20 |n..You m|ay omit |
|00003fb0| 61 6e 79 20 6f 72 20 61 | 6c 6c 20 6f 66 20 74 68 |any or a|ll of th|
|00003fc0| 65 73 65 20 66 69 74 73 | 2c 20 62 75 74 20 73 68 |ese fits|, but sh|
|00003fd0| 6f 75 6c 64 20 64 6f 63 | 75 6d 65 6e 74 20 69 74 |ould doc|ument it|
|00003fe0| 20 62 79 20 73 65 74 74 | 69 6e 67 20 74 68 65 0d | by sett|ing the.|
|00003ff0| 63 6f 72 72 65 73 70 6f | 6e 64 69 6e 67 20 65 72 |correspo|nding er|
|00004000| 72 6f 72 20 74 65 72 6d | 73 20 74 6f 20 69 6e 66 |ror term|s to inf|
|00004010| 69 6e 69 74 79 20 28 3d | 31 2e 30 2f 30 2e 30 29 |inity (=|1.0/0.0)|
|00004020| 2e 20 49 66 20 79 6f 75 | 20 6f 6d 69 74 20 61 6c |. If you| omit al|
|00004030| 6c 20 6f 66 20 74 68 65 | 6d 20 74 68 65 6e 0d 79 |l of the|m then.y|
|00004040| 6f 75 20 6d 75 73 74 20 | 73 75 70 70 6c 79 20 61 |ou must |supply a|
|00004050| 20 74 61 62 6c 65 20 64 | 65 73 63 72 69 62 69 6e | table d|escribin|
|00004060| 67 20 74 68 65 20 67 61 | 6d 6d 61 20 66 75 6e 63 |g the ga|mma func|
|00004070| 74 69 6f 6e 2c 20 65 2e | 67 2e 0d 09 4c 52 2e 4c |tion, e.|g...LR.L|
|00004080| 2e 5f 56 4d 69 6e 3d 44 | 6f 75 62 6c 65 54 6f 46 |._VMin=D|oubleToF|
|00004090| 69 78 28 30 2e 29 3b 09 | 2f 2a 20 69 66 20 70 6f |ix(0.);.|/* if po|
|000040a0| 73 73 69 62 6c 65 2c 20 | 72 65 73 74 72 69 63 74 |ssible, |restrict|
|000040b0| 20 74 6f 20 6a 75 73 74 | 20 74 68 65 20 6d 6f 6e | to just| the mon|
|000040c0| 6f 74 6f 6e 69 63 20 72 | 61 6e 67 65 20 2a 2f 0d |otonic r|ange */.|
|000040d0| 09 4c 52 2e 4c 2e 5f 56 | 4d 61 78 3d 44 6f 75 62 |.LR.L._V|Max=Doub|
|000040e0| 6c 65 54 6f 46 69 78 28 | 32 35 35 2e 29 3b 09 2f |leToFix(|255.);./|
|000040f0| 2a 20 69 66 20 70 6f 73 | 73 69 62 6c 65 2c 20 72 |* if pos|sible, r|
|00004100| 65 73 74 72 69 63 74 20 | 74 6f 20 6a 75 73 74 20 |estrict |to just |
|00004110| 74 68 65 20 6d 6f 6e 6f | 74 6f 6e 69 63 20 72 61 |the mono|tonic ra|
|00004120| 6e 67 65 20 2a 2f 0d 09 | 4c 52 2e 4c 2e 5f 64 56 |nge */..|LR.L._dV|
|00004130| 3d 28 4c 52 2e 4c 2e 5f | 56 4d 61 78 2d 4c 52 2e |=(LR.L._|VMax-LR.|
|00004140| 4c 2e 5f 56 4d 69 6e 29 | 2f 28 4c 55 4d 49 4e 41 |L._VMin)|/(LUMINA|
|00004150| 4e 43 45 53 5f 49 4e 5f | 54 41 42 4c 45 2d 31 29 |NCES_IN_|TABLE-1)|
|00004160| 3b 0d 09 4c 52 2e 4c 2e | 6c 61 74 65 73 74 49 6e |;..LR.L.|latestIn|
|00004170| 64 65 78 3d 2d 31 3b 09 | 09 09 2f 2a 20 69 6e 76 |dex=-1;.|../* inv|
|00004180| 61 6c 69 64 20 6c 61 74 | 65 73 74 49 6e 64 65 78 |alid lat|estIndex|
|00004190| 2c 20 73 6f 20 68 75 6e | 74 20 77 69 6c 6c 20 73 |, so hun|t will s|
|000041a0| 74 61 72 74 20 66 72 6f | 6d 20 73 63 72 61 74 63 |tart fro|m scratc|
|000041b0| 68 20 2a 2f 0d 09 4c 52 | 2e 4c 2e 65 78 69 73 74 |h */..LR|.L.exist|
|000041c0| 73 3d 6c 75 6d 69 6e 61 | 6e 63 65 53 65 74 3b 09 |s=lumina|nceSet;.|
|000041d0| 09 2f 2a 20 6d 61 72 6b | 20 74 61 62 6c 65 20 61 |./* mark| table a|
|000041e0| 73 20 76 61 6c 69 64 20 | 2a 2f 0d 09 4c 52 2e 4c |s valid |*/..LR.L|
|000041f0| 2e 5f 4c 75 5b 30 5d 3d | 44 6f 75 62 6c 65 54 6f |._Lu[0]=|DoubleTo|
|00004200| 46 69 78 28 30 2e 35 37 | 29 3b 0d 09 4c 52 2e 4c |Fix(0.57|);..LR.L|
|00004210| 2e 5f 4c 75 5b 31 5d 3d | 44 6f 75 62 6c 65 54 6f |._Lu[1]=|DoubleTo|
|00004220| 46 69 78 28 30 2e 35 37 | 29 3b 0d 09 2e 2e 2e 0d |Fix(0.57|);......|
|00004230| 09 4c 52 2e 4c 2e 5f 4c | 75 5b 4c 55 4d 49 4e 41 |.LR.L._L|u[LUMINA|
|00004240| 4e 43 45 53 5f 49 4e 5f | 54 41 42 4c 45 2d 31 5d |NCES_IN_|TABLE-1]|
|00004250| 3d 44 6f 75 62 6c 65 54 | 6f 46 69 78 28 31 30 31 |=DoubleT|oFix(101|
|00004260| 2e 31 33 29 3b 0d 22 4c | 55 4d 49 4e 41 4e 43 45 |.13);."L|UMINANCE|
|00004270| 53 5f 49 4e 5f 54 41 42 | 4c 45 22 20 69 73 20 63 |S_IN_TAB|LE" is c|
|00004280| 75 72 72 65 6e 74 6c 79 | 20 64 65 66 69 6e 65 64 |urrently| defined|
|00004290| 20 74 6f 20 62 65 20 31 | 32 38 20 69 6e 20 4c 75 | to be 1|28 in Lu|
|000042a0| 6d 69 6e 61 6e 63 65 2e | 68 2e 20 4e 6f 72 6d 61 |minance.|h. Norma|
|000042b0| 6c 6c 79 20 74 68 69 73 | 20 0d 74 61 62 6c 65 20 |lly this| .table |
|000042c0| 69 73 20 73 79 6e 74 68 | 65 73 69 7a 65 64 20 61 |is synth|esized a|
|000042d0| 74 20 72 75 6e 20 74 69 | 6d 65 2c 20 66 72 6f 6d |t run ti|me, from|
|000042e0| 20 6f 6e 65 20 6f 66 20 | 74 68 65 20 66 6f 72 6d | one of |the form|
|000042f0| 75 6c 61 69 63 20 64 65 | 73 63 72 69 70 74 69 6f |ulaic de|scriptio|
|00004300| 6e 73 2c 0d 62 75 74 20 | 79 6f 75 20 6d 61 79 20 |ns,.but |you may |
|00004310| 70 72 65 66 65 72 20 74 | 6f 20 73 75 70 70 6c 79 |prefer t|o supply|
|00004320| 20 69 74 20 64 69 72 65 | 63 74 6c 79 2c 20 70 6f | it dire|ctly, po|
|00004330| 73 73 69 62 6c 79 20 75 | 73 69 6e 67 20 74 68 65 |ssibly u|sing the|
|00004340| 20 72 61 77 20 6d 65 61 | 73 75 72 65 6d 65 6e 74 | raw mea|surement|
|00004350| 73 2c 0d 61 6e 64 20 6e | 6f 74 20 62 6f 74 68 65 |s,.and n|ot bothe|
|00004360| 72 20 77 69 74 68 20 61 | 6e 79 20 66 69 74 74 69 |r with a|ny fitti|
|00004370| 6e 67 2e 20 54 68 65 20 | 66 6f 72 6d 75 6c 61 73 |ng. The |formulas|
|00004380| 20 61 72 65 20 6e 6f 74 | 20 75 73 65 64 20 69 66 | are not| used if|
|00004390| 20 74 68 65 20 74 61 62 | 6c 65 20 69 73 20 73 75 | the tab|le is su|
|000043a0| 70 70 6c 69 65 64 2e 0d | 0d 54 6f 20 66 69 6c 6c |pplied..|.To fill|
|000043b0| 20 69 6e 20 74 68 65 20 | 6e 75 6d 62 65 72 73 20 | in the |numbers |
|000043c0| 61 62 6f 76 65 2c 20 79 | 6f 75 20 68 61 76 65 20 |above, y|ou have |
|000043d0| 74 6f 20 64 6f 20 74 77 | 6f 20 63 61 6c 69 62 72 |to do tw|o calibr|
|000043e0| 61 74 69 6f 6e 73 2e 20 | 28 54 68 69 73 20 69 73 |ations. |(This is|
|000043f0| 20 77 68 61 74 20 74 68 | 65 0d 43 61 6c 69 62 72 | what th|e.Calibr|
|00004400| 61 74 65 4c 75 6d 69 6e | 61 6e 63 65 20 70 72 6f |ateLumin|ance pro|
|00004410| 67 72 61 6d 20 64 6f 65 | 73 2e 29 0d 0d 30 2e 20 |gram doe|s.)..0. |
|00004420| 42 65 66 6f 72 65 20 73 | 74 61 72 74 69 6e 67 2c |Before s|tarting,|
|00004430| 20 63 61 6c 6c 20 47 44 | 4c 69 6e 65 61 72 47 61 | call GD|LinearGa|
|00004440| 6d 6d 61 28 29 2e 20 28 | 4e 6f 74 65 20 74 68 61 |mma(). (|Note tha|
|00004450| 74 20 47 44 4f 70 65 6e | 57 69 6e 64 6f 77 20 0d |t GDOpen|Window .|
|00004460| 61 75 74 6f 6d 61 74 69 | 63 61 6c 6c 79 20 63 61 |automati|cally ca|
|00004470| 6c 6c 73 20 47 44 4c 69 | 6e 65 61 72 47 61 6d 6d |lls GDLi|nearGamm|
|00004480| 61 20 66 6f 72 20 79 6f | 75 2e 29 20 41 6c 6c 20 |a for yo|u.) All |
|00004490| 63 61 6c 69 62 72 61 74 | 69 6f 6e 73 20 73 68 6f |calibrat|ions sho|
|000044a0| 75 6c 64 20 62 65 20 64 | 6f 6e 65 0d 77 69 74 68 |uld be d|one.with|
|000044b0| 20 74 68 65 20 49 53 52 | 20 56 69 64 65 6f 20 41 | the ISR| Video A|
|000044c0| 74 74 65 6e 75 61 74 6f | 72 20 69 6e 20 70 6c 61 |ttenuato|r in pla|
|000044d0| 63 65 2e 0d 0d 31 2e 20 | 4d 65 61 73 75 72 65 20 |ce...1. |Measure |
|000044e0| 74 68 65 20 6c 75 6d 69 | 6e 61 6e 63 65 20 76 65 |the lumi|nance ve|
|000044f0| 72 73 75 73 20 22 76 6f | 6c 74 61 67 65 22 20 6e |rsus "vo|ltage" n|
|00004500| 6f 6e 6c 69 6e 65 61 72 | 69 74 79 20 6f 66 20 79 |onlinear|ity of y|
|00004510| 6f 75 72 20 6d 6f 6e 69 | 74 6f 72 2e 0d 49 20 75 |our moni|tor..I u|
|00004520| 73 65 20 61 20 73 65 70 | 61 72 61 74 65 20 70 72 |se a sep|arate pr|
|00004530| 6f 67 72 61 6d 20 22 43 | 61 6c 69 62 72 61 74 65 |ogram "C|alibrate|
|00004540| 4c 75 6d 69 6e 61 6e 63 | 65 22 20 74 6f 20 6d 65 |Luminanc|e" to me|
|00004550| 61 73 75 72 65 20 74 68 | 65 20 73 63 72 65 65 6e |asure th|e screen|
|00004560| 20 6c 75 6d 69 6e 61 6e | 63 65 20 61 74 20 76 61 | luminan|ce at va|
|00004570| 6c 75 65 73 0d 6f 66 20 | 56 20 66 72 6f 6d 20 30 |lues.of |V from 0|
|00004580| 20 74 6f 20 32 35 35 2e | 20 46 6f 72 20 74 68 69 | to 255.| For thi|
|00004590| 73 20 63 61 6c 69 62 72 | 61 74 69 6f 6e 20 79 6f |s calibr|ation yo|
|000045a0| 75 20 6c 6f 61 64 20 65 | 71 75 61 6c 20 76 61 6c |u load e|qual val|
|000045b0| 75 65 73 20 69 6e 74 6f | 20 52 65 64 2c 20 47 72 |ues into| Red, Gr|
|000045c0| 65 65 6e 2c 20 61 6e 64 | 20 42 6c 75 65 0d 6c 6f |een, and| Blue.lo|
|000045d0| 6f 6b 75 70 20 74 61 62 | 6c 65 73 2e 20 49 20 75 |okup tab|les. I u|
|000045e0| 73 65 20 71 75 61 64 72 | 61 74 69 63 2c 20 70 6f |se quadr|atic, po|
|000045f0| 6c 79 6e 6f 6d 69 61 6c | 2c 20 61 6e 64 20 70 6f |lynomial|, and po|
|00004600| 77 65 72 20 6c 61 77 20 | 66 69 74 73 2e 20 53 65 |wer law |fits. Se|
|00004610| 65 20 50 65 6c 6c 69 20 | 26 20 5a 68 61 6e 67 20 |e Pelli |& Zhang |
|00004620| 28 31 39 39 31 29 2e 0d | 0d 59 6f 75 20 6d 75 73 |(1991)..|.You mus|
|00004630| 74 20 73 65 74 20 4c 52 | 2e 4c 4d 69 6e 20 61 6e |t set LR|.LMin an|
|00004640| 64 20 4c 52 2e 4c 4d 61 | 78 20 74 6f 20 74 68 65 |d LR.LMa|x to the|
|00004650| 20 6c 75 6d 69 6e 61 6e | 63 65 73 20 61 74 20 4c | luminan|ces at L|
|00004660| 52 2e 56 4d 69 6e 20 61 | 6e 64 20 4c 52 2e 56 4d |R.VMin a|nd LR.VM|
|00004670| 61 78 2e 0d 0d 54 68 65 | 20 66 6f 6c 6c 6f 77 69 |ax...The| followi|
|00004680| 6e 67 20 70 72 6f 67 72 | 61 6d 20 66 72 61 67 6d |ng progr|am fragm|
|00004690| 65 6e 74 20 61 6c 6c 6f | 77 73 20 79 6f 75 20 74 |ent allo|ws you t|
|000046a0| 6f 20 6d 65 61 73 75 72 | 65 20 74 68 65 20 73 63 |o measur|e the sc|
|000046b0| 72 65 65 6e 20 6c 75 6d | 69 6e 61 6e 63 65 20 61 |reen lum|inance a|
|000046c0| 73 20 61 20 66 75 6e 63 | 74 69 6f 6e 0d 6f 66 20 |s a func|tion.of |
|000046d0| 6e 6f 6d 69 6e 61 6c 20 | 76 6f 6c 74 61 67 65 2e |nominal |voltage.|
|000046e0| 0d 0d 23 69 6e 63 6c 75 | 64 65 20 3c 6d 61 74 68 |..#inclu|de <math|
|000046f0| 2e 68 3e 0d 23 69 6e 63 | 6c 75 64 65 20 22 56 69 |.h>.#inc|lude "Vi|
|00004700| 64 65 6f 54 6f 6f 6c 62 | 6f 78 2e 68 22 0d 23 69 |deoToolb|ox.h".#i|
|00004710| 6e 63 6c 75 64 65 20 22 | 4c 75 6d 69 6e 61 6e 63 |nclude "|Luminanc|
|00004720| 65 2e 68 22 0d 0d 76 6f | 69 64 20 6d 61 69 6e 28 |e.h"..vo|id main(|
|00004730| 76 6f 69 64 29 0d 7b 0d | 09 4c 75 6d 69 6e 61 6e |void).{.|.Luminan|
|00004740| 63 65 52 65 63 6f 72 64 | 20 4c 52 3b 0d 09 69 6e |ceRecord| LR;..in|
|00004750| 74 20 56 2c 69 2c 64 6f | 6e 65 3b 0d 09 64 6f 75 |t V,i,do|ne;..dou|
|00004760| 62 6c 65 20 61 3b 0d 09 | 47 44 48 61 6e 64 6c 65 |ble a;..|GDHandle|
|00004770| 20 6f 6c 64 44 65 76 69 | 63 65 2c 64 65 76 69 63 | oldDevi|ce,devic|
|00004780| 65 3b 0d 09 43 57 69 6e | 64 6f 77 50 74 72 20 63 |e;..CWin|dowPtr c|
|00004790| 57 69 6e 64 6f 77 2c 6f | 6c 64 43 57 69 6e 64 6f |Window,o|ldCWindo|
|000047a0| 77 3b 0d 09 63 68 61 72 | 20 73 74 72 69 6e 67 5b |w;..char| string[|
|000047b0| 33 32 5d 3b 0d 09 0d 09 | 23 69 6e 63 6c 75 64 65 |32];....|#include|
|000047c0| 20 22 4c 75 6d 69 6e 61 | 6e 63 65 52 65 63 6f 72 | "Lumina|nceRecor|
|000047d0| 64 31 2e 68 22 0d 09 47 | 65 74 47 57 6f 72 6c 64 |d1.h"..G|etGWorld|
|000047e0| 28 26 6f 6c 64 43 57 69 | 6e 64 6f 77 2c 26 6f 6c |(&oldCWi|ndow,&ol|
|000047f0| 64 44 65 76 69 63 65 29 | 3b 0d 09 4c 52 2e 73 63 |dDevice)|;..LR.sc|
|00004800| 72 65 65 6e 3d 31 3b 0d | 09 64 65 76 69 63 65 3d |reen=1;.|.device=|
|00004810| 47 65 74 53 63 72 65 65 | 6e 44 65 76 69 63 65 28 |GetScree|nDevice(|
|00004820| 4c 52 2e 73 63 72 65 65 | 6e 29 3b 09 2f 2a 20 73 |LR.scree|n);./* s|
|00004830| 63 72 65 65 6e 20 31 20 | 2a 2f 0d 09 63 57 69 6e |creen 1 |*/..cWin|
|00004840| 64 6f 77 3d 47 44 4f 70 | 65 6e 57 69 6e 64 6f 77 |dow=GDOp|enWindow|
|00004850| 28 64 65 76 69 63 65 29 | 3b 09 09 2f 2a 20 4f 70 |(device)|;../* Op|
|00004860| 65 6e 20 61 20 66 75 6c | 6c 2d 73 63 72 65 65 6e |en a ful|l-screen|
|00004870| 20 77 69 6e 64 6f 77 20 | 77 69 74 68 20 65 78 70 | window |with exp|
|00004880| 6c 69 63 69 74 20 63 6f | 6c 6f 72 73 20 2a 2f 0d |licit co|lors */.|
|00004890| 09 53 65 74 47 57 6f 72 | 6c 64 28 63 57 69 6e 64 |.SetGWor|ld(cWind|
|000048a0| 6f 77 2c 64 65 76 69 63 | 65 29 3b 0d 09 50 6d 42 |ow,devic|e);..PmB|
|000048b0| 61 63 6b 43 6f 6c 6f 72 | 28 31 29 3b 09 09 09 09 |ackColor|(1);....|
|000048c0| 09 09 2f 2a 20 70 69 63 | 6b 20 61 20 63 6f 6c 6f |../* pic|k a colo|
|000048d0| 72 20 74 61 62 6c 65 20 | 65 6e 74 72 79 20 2a 2f |r table |entry */|
|000048e0| 0d 09 45 72 61 73 65 52 | 65 63 74 28 26 63 57 69 |..EraseR|ect(&cWi|
|000048f0| 6e 64 6f 77 2d 3e 70 6f | 72 74 52 65 63 74 29 3b |ndow->po|rtRect);|
|00004900| 09 09 2f 2a 20 66 69 6c | 6c 20 77 68 6f 6c 65 20 |../* fil|l whole |
|00004910| 77 69 6e 64 6f 77 20 77 | 69 74 68 20 74 68 61 74 |window w|ith that|
|00004920| 20 63 6f 6c 6f 72 20 2a | 2f 0d 09 53 65 74 47 57 | color *|/..SetGW|
|00004930| 6f 72 6c 64 28 6f 6c 64 | 43 57 69 6e 64 6f 77 2c |orld(old|CWindow,|
|00004940| 6f 6c 64 44 65 76 69 63 | 65 29 3b 0d 09 4c 52 2e |oldDevic|e);..LR.|
|00004950| 4c 2e 5f 56 4d 69 6e 3d | 44 6f 75 62 6c 65 54 6f |L._VMin=|DoubleTo|
|00004960| 46 69 78 28 30 2e 29 3b | 09 09 09 2f 2a 20 69 66 |Fix(0.);|.../* if|
|00004970| 20 70 6f 73 73 69 62 6c | 65 2c 20 72 65 73 74 72 | possibl|e, restr|
|00004980| 69 63 74 20 74 6f 20 6a | 75 73 74 20 74 68 65 20 |ict to j|ust the |
|00004990| 73 74 72 69 63 74 6c 79 | 20 6d 6f 6e 6f 74 6f 6e |strictly| monoton|
|000049a0| 69 63 20 72 61 6e 67 65 | 20 2a 2f 0d 09 4c 52 2e |ic range| */..LR.|
|000049b0| 4c 2e 5f 56 4d 61 78 3d | 44 6f 75 62 6c 65 54 6f |L._VMax=|DoubleTo|
|000049c0| 46 69 78 28 32 35 35 2e | 29 3b 0d 09 64 6f 6e 65 |Fix(255.|);..done|
|000049d0| 3d 30 3b 0d 09 66 6f 72 | 28 69 3d 30 3b 69 3c 4c |=0;..for|(i=0;i<L|
|000049e0| 55 4d 49 4e 41 4e 43 45 | 53 5f 49 4e 5f 54 41 42 |UMINANCE|S_IN_TAB|
|000049f0| 4c 45 3b 69 2b 2b 29 7b | 0d 09 09 4c 52 2e 4c 2e |LE;i++){|...LR.L.|
|00004a00| 5f 64 56 3d 63 65 69 6c | 28 46 69 78 54 6f 44 6f |_dV=ceil|(FixToDo|
|00004a10| 75 62 6c 65 28 4c 52 2e | 4c 2e 5f 56 4d 61 78 2d |uble(LR.|L._VMax-|
|00004a20| 4c 52 2e 4c 2e 5f 56 4d | 69 6e 29 2f 28 4c 55 4d |LR.L._VM|in)/(LUM|
|00004a30| 49 4e 41 4e 43 45 53 5f | 49 4e 5f 54 41 42 4c 45 |INANCES_|IN_TABLE|
|00004a40| 2d 31 29 29 3b 0d 09 09 | 56 3d 46 69 78 54 6f 4c |-1));...|V=FixToL|
|00004a50| 6f 6e 67 28 69 2a 4c 52 | 2e 4c 2e 5f 64 56 29 3b |ong(i*LR|.L._dV);|
|00004a60| 0d 09 09 69 66 28 56 3e | 3d 46 69 78 54 6f 4c 6f |...if(V>|=FixToLo|
|00004a70| 6e 67 28 4c 52 2e 4c 2e | 5f 56 4d 61 78 29 29 7b |ng(LR.L.|_VMax)){|
|00004a80| 0d 09 09 09 56 3d 46 69 | 78 54 6f 4c 6f 6e 67 28 |....V=Fi|xToLong(|
|00004a90| 4c 52 2e 4c 2e 5f 56 4d | 61 78 29 3b 0d 09 09 09 |LR.L._VM|ax);....|
|00004aa0| 64 6f 6e 65 3d 31 3b 0d | 09 09 7d 0d 09 09 4c 52 |done=1;.|..}...LR|
|00004ab0| 2e 74 61 62 6c 65 5b 31 | 5d 2e 72 67 62 2e 72 65 |.table[1|].rgb.re|
|00004ac0| 64 09 09 3d 56 3c 3c 38 | 3b 09 2f 2a 20 53 65 74 |d..=V<<8|;./* Set|
|00004ad0| 20 63 6f 6c 6f 72 20 74 | 61 62 6c 65 20 65 6e 74 | color t|able ent|
|00004ae0| 72 79 20 31 2e 20 2a 2f | 0d 09 09 4c 52 2e 74 61 |ry 1. */|...LR.ta|
|00004af0| 62 6c 65 5b 31 5d 2e 72 | 67 62 2e 67 72 65 65 6e |ble[1].r|gb.green|
|00004b00| 09 3d 56 3c 3c 38 3b 0d | 09 09 4c 52 2e 74 61 62 |.=V<<8;.|..LR.tab|
|00004b10| 6c 65 5b 31 5d 2e 72 67 | 62 2e 62 6c 75 65 09 3d |le[1].rg|b.blue.=|
|00004b20| 56 3c 3c 38 3b 0d 09 09 | 4c 6f 61 64 4c 75 6d 69 |V<<8;...|LoadLumi|
|00004b30| 6e 61 6e 63 65 73 28 64 | 65 76 69 63 65 2c 26 4c |nances(d|evice,&L|
|00004b40| 52 2c 31 2c 31 29 3b 09 | 2f 2a 20 43 6f 70 79 20 |R,1,1);.|/* Copy |
|00004b50| 63 6f 6c 6f 72 20 74 61 | 62 6c 65 20 65 6e 74 72 |color ta|ble entr|
|00004b60| 79 20 31 20 74 6f 20 43 | 4c 55 54 20 2a 2f 0d 09 |y 1 to C|LUT */..|
|00004b70| 09 70 72 69 6e 74 66 28 | 22 25 33 64 20 50 6c 65 |.printf(|"%3d Ple|
|00004b80| 61 73 65 20 6d 65 61 73 | 75 72 65 20 73 63 72 65 |ase meas|ure scre|
|00004b90| 65 6e 20 6c 75 6d 69 6e | 61 6e 63 65 20 6e 6f 77 |en lumin|ance now|
|00004ba0| 2c 20 69 6e 20 25 73 2c | 20 61 6e 64 20 74 79 70 |, in %s,| and typ|
|00004bb0| 65 20 69 6e 3a 22 2c 56 | 2c 4c 52 2e 75 6e 69 74 |e in:",V|,LR.unit|
|00004bc0| 73 29 3b 0d 09 09 67 65 | 74 73 28 73 74 72 69 6e |s);...ge|ts(strin|
|00004bd0| 67 29 3b 0d 09 09 73 73 | 63 61 6e 66 28 73 74 72 |g);...ss|canf(str|
|00004be0| 69 6e 67 2c 22 25 6c 66 | 22 2c 26 61 29 3b 0d 09 |ing,"%lf|",&a);..|
|00004bf0| 09 70 72 69 6e 74 66 28 | 22 25 36 2e 32 67 20 25 |.printf(|"%6.2g %|
|00004c00| 73 5c 6e 22 2c 61 2c 4c | 52 2e 75 6e 69 74 73 29 |s\n",a,L|R.units)|
|00004c10| 3b 0d 09 09 4c 52 2e 4c | 2e 5f 4c 75 5b 69 5d 3d |;...LR.L|._Lu[i]=|
|00004c20| 44 6f 75 62 6c 65 54 6f | 46 69 78 28 61 29 3b 0d |DoubleTo|Fix(a);.|
|00004c30| 09 09 69 66 28 64 6f 6e | 65 29 62 72 65 61 6b 3b |..if(don|e)break;|
|00004c40| 0d 09 09 69 66 28 4c 52 | 2e 4c 2e 5f 4c 75 5b 69 |...if(LR|.L._Lu[i|
|00004c50| 5d 3c 3d 4c 52 2e 4c 2e | 5f 4c 75 5b 30 5d 29 7b |]<=LR.L.|_Lu[0]){|
|00004c60| 09 2f 2a 20 72 65 73 74 | 72 69 63 74 20 74 6f 20 |./* rest|rict to |
|00004c70| 6a 75 73 74 20 74 68 65 | 20 73 74 72 69 63 74 6c |just the| strictl|
|00004c80| 79 20 6d 6f 6e 6f 74 6f | 6e 69 63 20 72 61 6e 67 |y monoto|nic rang|
|00004c90| 65 20 2a 2f 0d 09 09 09 | 4c 52 2e 4c 2e 5f 56 4d |e */....|LR.L._VM|
|00004ca0| 69 6e 3d 4c 6f 6e 67 54 | 6f 46 69 78 28 56 29 3b |in=LongT|oFix(V);|
|00004cb0| 0d 09 09 09 4c 52 2e 4c | 2e 5f 4c 75 5b 30 5d 3d |....LR.L|._Lu[0]=|
|00004cc0| 4c 52 2e 4c 2e 5f 4c 75 | 5b 69 5d 3b 0d 09 09 09 |LR.L._Lu|[i];....|
|00004cd0| 69 3d 30 3b 0d 09 09 7d | 0d 09 7d 0d 09 4c 52 2e |i=0;...}|..}..LR.|
|00004ce0| 4c 2e 6c 61 74 65 73 74 | 49 6e 64 65 78 3d 2d 31 |L.latest|Index=-1|
|00004cf0| 3b 09 09 09 2f 2a 20 69 | 6e 76 61 6c 69 64 20 6c |;.../* i|nvalid l|
|00004d00| 61 74 65 73 74 49 6e 64 | 65 78 2c 20 73 6f 20 68 |atestInd|ex, so h|
|00004d10| 75 6e 74 20 77 69 6c 6c | 20 73 74 61 72 74 20 66 |unt will| start f|
|00004d20| 72 6f 6d 20 73 63 72 61 | 74 63 68 20 2a 2f 0d 09 |rom scra|tch */..|
|00004d30| 4c 52 2e 4c 2e 65 78 69 | 73 74 73 3d 6c 75 6d 69 |LR.L.exi|sts=lumi|
|00004d40| 6e 61 6e 63 65 53 65 74 | 3b 09 09 2f 2a 20 6d 61 |nanceSet|;../* ma|
|00004d50| 72 6b 20 74 61 62 6c 65 | 20 61 73 20 76 61 6c 69 |rk table| as vali|
|00004d60| 64 20 2a 2f 0d 7d 0d 0d | 32 2e 20 4d 65 61 73 75 |d */.}..|2. Measu|
|00004d70| 72 65 20 74 68 65 20 67 | 61 69 6e 73 20 6f 66 20 |re the g|ains of |
|00004d80| 74 68 65 20 74 68 72 65 | 65 20 69 6e 70 75 74 73 |the thre|e inputs|
|00004d90| 20 6f 66 20 79 6f 75 72 | 20 49 53 52 20 56 69 64 | of your| ISR Vid|
|00004da0| 65 6f 20 41 74 74 65 6e | 75 61 74 6f 72 2e 20 59 |eo Atten|uator. Y|
|00004db0| 6f 75 20 63 6f 75 6c 64 | 0d 64 6f 20 74 68 69 73 |ou could|.do this|
|00004dc0| 20 62 79 20 75 73 69 6e | 67 20 61 6e 20 6f 73 63 | by usin|g an osc|
|00004dd0| 69 6c 6c 6f 73 63 6f 70 | 65 20 74 6f 20 6d 65 61 |illoscop|e to mea|
|00004de0| 73 75 72 69 6e 67 20 74 | 68 65 20 76 6f 6c 74 61 |suring t|he volta|
|00004df0| 67 65 20 61 74 20 74 68 | 65 20 69 6e 70 75 74 20 |ge at th|e input |
|00004e00| 74 6f 20 74 68 65 20 6d | 6f 6e 69 74 6f 72 2e 0d |to the m|onitor..|
|00004e10| 49 6e 73 74 65 61 64 2c | 20 49 20 6d 65 61 73 75 |Instead,| I measu|
|00004e20| 72 65 20 74 68 65 20 72 | 65 73 75 6c 74 69 6e 67 |re the r|esulting|
|00004e30| 20 6c 75 6d 69 6e 61 6e | 63 65 20 61 6e 64 20 75 | luminan|ce and u|
|00004e40| 73 65 20 4c 54 6f 56 28 | 29 20 74 6f 20 69 6e 66 |se LToV(|) to inf|
|00004e50| 65 72 20 74 68 65 20 76 | 6f 6c 74 61 67 65 2e 0d |er the v|oltage..|
|00004e60| 56 61 72 79 20 6f 6e 65 | 20 44 41 43 20 77 68 69 |Vary one| DAC whi|
|00004e70| 6c 65 20 68 6f 6c 64 69 | 6e 67 20 74 68 65 20 6f |le holdi|ng the o|
|00004e80| 74 68 65 72 20 74 77 6f | 20 66 69 78 65 64 20 61 |ther two| fixed a|
|00004e90| 74 20 32 35 35 20 61 6e | 64 20 6d 65 61 73 75 72 |t 255 an|d measur|
|00004ea0| 65 20 74 68 65 20 6c 75 | 6d 69 6e 61 6e 63 65 73 |e the lu|minances|
|00004eb0| 2e 20 0d 55 73 65 20 74 | 68 65 20 66 75 6e 63 74 |. .Use t|he funct|
|00004ec0| 69 6f 6e 20 4c 54 6f 56 | 28 29 20 74 6f 20 63 6f |ion LToV|() to co|
|00004ed0| 6e 76 65 72 74 20 62 61 | 63 6b 20 74 6f 20 61 20 |nvert ba|ck to a |
|00004ee0| 22 76 6f 6c 74 61 67 65 | 22 20 61 6e 64 20 63 6f |"voltage|" and co|
|00004ef0| 6d 70 75 74 65 20 74 68 | 65 20 67 61 69 6e 20 6f |mpute th|e gain o|
|00004f00| 66 20 74 68 65 0d 76 61 | 72 79 69 6e 67 20 44 41 |f the.va|rying DA|
|00004f10| 43 2e 20 4e 6f 74 65 20 | 74 68 61 74 20 74 68 65 |C. Note |that the|
|00004f20| 20 74 68 72 65 65 20 44 | 41 43 73 20 6f 6e 20 79 | three D|ACs on y|
|00004f30| 6f 75 72 20 66 72 61 6d | 65 73 74 6f 72 65 20 77 |our fram|estore w|
|00004f40| 69 6c 6c 20 67 65 6e 65 | 72 61 6c 6c 79 20 68 61 |ill gene|rally ha|
|00004f50| 76 65 20 67 61 69 6e 73 | 20 74 68 61 74 0d 6d 61 |ve gains| that.ma|
|00004f60| 74 63 68 20 74 6f 20 6f | 6e 6c 79 20 b1 35 25 2e |tch to o|nly .5%.|
|00004f70| 20 54 68 69 73 20 63 61 | 6c 69 62 72 61 74 69 6f | This ca|libratio|
|00004f80| 6e 20 69 73 20 6d 65 61 | 73 75 72 69 6e 67 20 74 |n is mea|suring t|
|00004f90| 68 65 20 6f 76 65 72 61 | 6c 6c 20 67 61 69 6e 20 |he overa|ll gain |
|00004fa0| 6f 66 20 65 61 63 68 20 | 6f 66 20 74 68 65 20 74 |of each |of the t|
|00004fb0| 68 72 65 65 0d 70 61 74 | 68 77 61 79 73 2c 20 69 |hree.pat|hways, i|
|00004fc0| 6e 63 6c 75 64 69 6e 67 | 20 79 6f 75 72 20 44 41 |ncluding| your DA|
|00004fd0| 43 73 20 61 6e 64 20 74 | 68 65 20 49 53 52 20 56 |Cs and t|he ISR V|
|00004fe0| 69 64 65 6f 20 41 74 74 | 65 6e 75 61 74 6f 72 2e |ideo Att|enuator.|
|00004ff0| 09 0d 0d 4c 49 4d 49 54 | 41 54 49 4f 4e 53 3a 0d |...LIMIT|ATIONS:.|
|00005000| 0d 49 74 20 69 73 20 69 | 6d 70 65 72 61 74 69 76 |.It is i|mperativ|
|00005010| 65 20 74 68 61 74 20 79 | 6f 75 20 63 61 6c 6c 20 |e that y|ou call |
|00005020| 47 44 4c 69 6e 65 61 72 | 47 61 6d 6d 61 28 29 20 |GDLinear|Gamma() |
|00005030| 61 74 20 73 6f 6d 65 20 | 74 69 6d 65 20 62 65 66 |at some |time bef|
|00005040| 6f 72 65 20 75 73 69 6e | 67 0d 53 65 74 4c 75 6d |ore usin|g.SetLum|
|00005050| 69 6e 61 6e 63 65 73 2e | 20 53 65 74 4c 75 6d 69 |inances.| SetLumi|
|00005060| 6e 61 6e 63 65 73 20 41 | 53 53 55 4d 45 53 20 74 |nances A|SSUMES t|
|00005070| 68 61 74 20 6e 6f 20 67 | 61 6d 6d 61 20 63 6f 72 |hat no g|amma cor|
|00005080| 72 65 63 74 69 6f 6e 20 | 74 61 6b 65 73 20 70 6c |rection |takes pl|
|00005090| 61 63 65 2e 20 59 6f 75 | 0d 6f 6e 6c 79 20 6e 65 |ace. You|.only ne|
|000050a0| 65 64 20 74 6f 20 63 61 | 6c 6c 20 47 44 4c 69 6e |ed to ca|ll GDLin|
|000050b0| 65 61 72 47 61 6d 6d 61 | 20 6f 6e 63 65 2e 20 49 |earGamma| once. I|
|000050c0| 74 20 77 69 6c 6c 20 73 | 74 61 79 20 74 68 61 74 |t will s|tay that|
|000050d0| 20 77 61 79 20 75 6e 74 | 69 6c 20 74 68 65 20 6e | way unt|il the n|
|000050e0| 65 78 74 20 74 69 6d 65 | 0d 79 6f 75 20 72 65 73 |ext time|.you res|
|000050f0| 74 61 72 74 20 79 6f 75 | 72 20 63 6f 6d 70 75 74 |tart you|r comput|
|00005100| 65 72 2e 20 49 6e 63 69 | 64 65 6e 74 61 6c 6c 79 |er. Inci|dentally|
|00005110| 2c 20 47 44 4f 70 65 6e | 57 69 6e 64 6f 77 28 29 |, GDOpen|Window()|
|00005120| 20 63 61 6c 6c 73 20 47 | 44 4c 69 6e 65 61 72 47 | calls G|DLinearG|
|00005130| 61 6d 6d 61 20 66 6f 72 | 0d 79 6f 75 2e 0d 0d 54 |amma for|.you...T|
|00005140| 68 65 20 6c 75 6d 69 6e | 61 6e 63 65 20 63 61 6c |he lumin|ance cal|
|00005150| 69 62 72 61 74 69 6f 6e | 20 64 61 74 61 20 74 68 |ibration| data th|
|00005160| 61 74 20 79 6f 75 20 73 | 75 70 70 6c 79 20 74 6f |at you s|upply to|
|00005170| 20 53 65 74 4c 75 6d 69 | 6e 61 6e 63 65 73 20 6d | SetLumi|nances m|
|00005180| 75 73 74 20 61 6c 73 6f | 20 68 61 76 65 0d 62 65 |ust also| have.be|
|00005190| 65 6e 20 63 6f 6c 6c 65 | 63 74 65 64 20 77 69 74 |en colle|cted wit|
|000051a0| 68 20 6e 6f 20 67 61 6d | 6d 61 20 63 6f 72 72 65 |h no gam|ma corre|
|000051b0| 63 74 69 6f 6e 2c 20 69 | 2e 65 2e 20 41 46 54 45 |ction, i|.e. AFTE|
|000051c0| 52 20 63 61 6c 6c 69 6e | 67 20 47 44 4c 69 6e 65 |R callin|g GDLine|
|000051d0| 61 72 47 61 6d 6d 61 2e | 0d 0d 54 68 65 20 72 65 |arGamma.|..The re|
|000051e0| 61 73 6f 6e 20 74 68 61 | 74 20 67 61 6d 6d 61 20 |ason tha|t gamma |
|000051f0| 63 6f 72 72 65 63 74 69 | 6f 6e 20 69 73 20 6e 6f |correcti|on is no|
|00005200| 74 20 61 6c 6c 6f 77 65 | 64 20 69 73 20 74 68 61 |t allowe|d is tha|
|00005210| 74 20 69 74 20 77 6f 75 | 6c 64 20 72 65 73 75 6c |t it wou|ld resul|
|00005220| 74 20 69 6e 20 61 0d 6e | 6f 6e 6c 69 6e 65 61 72 |t in a.n|onlinear|
|00005230| 20 74 72 61 6e 73 66 6f | 72 6d 61 74 69 6f 6e 20 | transfo|rmation |
|00005240| 6f 66 20 74 68 65 20 74 | 68 72 65 65 20 63 68 61 |of the t|hree cha|
|00005250| 6e 6e 65 6c 73 20 42 45 | 46 4f 52 45 20 74 68 65 |nnels BE|FORE the|
|00005260| 79 20 61 72 65 20 63 6f | 6d 62 69 6e 65 64 20 69 |y are co|mbined i|
|00005270| 6e 20 74 68 65 0d 56 69 | 64 65 6f 20 41 74 74 65 |n the.Vi|deo Atte|
|00005280| 6e 75 61 74 6f 72 2e 0d | 0d 54 68 65 20 6d 65 61 |nuator..|.The mea|
|00005290| 73 75 72 65 6d 65 6e 74 | 20 6f 66 20 74 68 65 20 |surement| of the |
|000052a0| 67 61 69 6e 73 20 6f 66 | 20 74 68 65 20 74 68 72 |gains of| the thr|
|000052b0| 65 65 20 70 61 74 68 77 | 61 79 73 20 6d 75 73 74 |ee pathw|ays must|
|000052c0| 20 62 65 20 6d 61 64 65 | 20 75 73 69 6e 67 20 59 | be made| using Y|
|000052d0| 4f 55 52 0d 66 72 61 6d | 65 73 74 6f 72 65 2e 20 |OUR.fram|estore. |
|000052e0| 54 68 65 20 67 61 69 6e | 73 20 6f 66 20 79 6f 75 |The gain|s of you|
|000052f0| 72 20 74 68 72 65 65 20 | 44 41 43 73 20 77 69 6c |r three |DACs wil|
|00005300| 6c 20 69 6e 20 67 65 6e | 65 72 61 6c 20 62 65 20 |l in gen|eral be |
|00005310| 64 69 66 66 65 72 65 6e | 74 20 66 72 6f 6d 20 65 |differen|t from e|
|00005320| 61 63 68 0d 6f 74 68 65 | 72 2c 20 61 6e 64 20 64 |ach.othe|r, and d|
|00005330| 69 66 66 65 72 65 6e 74 | 20 66 72 6f 6d 20 66 72 |ifferent| from fr|
|00005340| 61 6d 65 73 74 6f 72 65 | 20 74 6f 20 66 72 61 6d |amestore| to fram|
|00005350| 65 73 74 6f 72 65 2e 20 | 42 72 6f 6f 6b 74 72 65 |estore. |Brooktre|
|00005360| 65 20 67 75 61 72 61 6e | 74 65 65 73 20 74 68 65 |e guaran|tees the|
|00005370| 0d 6d 61 74 63 68 69 6e | 67 20 6f 66 20 74 68 65 |.matchin|g of the|
|00005380| 20 67 61 69 6e 73 20 6f | 66 20 74 68 65 20 74 68 | gains o|f the th|
|00005390| 72 65 65 20 44 41 43 73 | 20 6f 6e 20 74 68 65 69 |ree DACs| on thei|
|000053a0| 72 20 63 68 69 70 20 74 | 6f 20 6f 6e 6c 79 20 b1 |r chip t|o only .|
|000053b0| 35 25 2e 0d 0d 54 68 65 | 20 6c 75 6d 69 6e 61 6e |5%...The| luminan|
|000053c0| 63 65 20 72 65 63 6f 72 | 64 20 6d 61 79 20 69 6e |ce recor|d may in|
|000053d0| 63 6c 75 64 65 20 65 69 | 74 68 65 72 20 61 20 74 |clude ei|ther a t|
|000053e0| 61 62 6c 65 20 6f 66 20 | 6c 75 6d 69 6e 61 6e 63 |able of |luminanc|
|000053f0| 65 20 63 61 6c 69 62 72 | 61 74 69 6f 6e 73 2e 20 |e calibr|ations. |
|00005400| 49 66 20 69 74 0d 69 73 | 20 6e 6f 74 20 73 75 70 |If it.is| not sup|
|00005410| 70 6c 69 65 64 20 74 68 | 65 6e 20 69 74 20 77 69 |plied th|en it wi|
|00005420| 6c 6c 20 62 65 20 73 79 | 6e 74 68 65 73 69 7a 65 |ll be sy|nthesize|
|00005430| 64 20 66 72 6f 6d 20 74 | 68 65 20 70 61 72 61 6d |d from t|he param|
|00005440| 65 74 65 72 73 20 6f 66 | 20 74 68 65 0d 70 6f 6c |eters of| the.pol|
|00005450| 79 6e 6f 6d 69 61 6c 20 | 6f 72 20 70 6f 77 65 72 |ynomial |or power|
|00005460| 20 6c 61 77 20 66 69 74 | 2e 20 49 66 20 74 68 65 | law fit|. If the|
|00005470| 20 70 6f 77 65 72 2c 20 | 70 6f 6c 79 6e 6f 6d 69 | power, |polynomi|
|00005480| 61 6c 2c 20 6f 72 20 71 | 75 61 64 72 61 74 69 63 |al, or q|uadratic|
|00005490| 20 66 69 74 0d 70 61 72 | 61 6d 65 74 65 72 73 20 | fit.par|ameters |
|000054a0| 61 72 65 20 6e 6f 74 20 | 73 75 70 70 6c 69 65 64 |are not |supplied|
|000054b0| 20 74 68 65 6e 20 74 68 | 65 20 61 70 70 72 6f 70 | then th|e approp|
|000054c0| 72 69 61 74 65 20 4c 52 | 2e 70 6f 77 65 72 45 72 |riate LR|.powerEr|
|000054d0| 72 6f 72 2c 0d 4c 52 2e | 70 6f 6c 79 6e 6f 6d 69 |ror,.LR.|polynomi|
|000054e0| 61 6c 45 72 72 6f 72 2c | 20 6f 72 20 4c 52 2e 71 |alError,| or LR.q|
|000054f0| 75 61 64 72 61 74 69 63 | 45 72 72 6f 72 20 66 69 |uadratic|Error fi|
|00005500| 65 6c 64 20 73 68 6f 75 | 6c 64 20 62 65 20 73 65 |eld shou|ld be se|
|00005510| 74 20 74 6f 20 69 6e 66 | 69 6e 69 74 79 0d 28 3d |t to inf|inity.(=|
|00005520| 30 2e 30 2f 31 2e 30 29 | 2e 0d 09 09 09 0d 54 68 |0.0/1.0)|......Th|
|00005530| 65 20 77 68 6f 6c 65 20 | 70 61 63 6b 61 67 65 20 |e whole |package |
|00005540| 69 73 20 61 74 20 70 72 | 65 73 65 6e 74 20 72 65 |is at pr|esent re|
|00005550| 73 74 72 69 63 74 65 64 | 20 74 6f 20 67 72 61 79 |stricted| to gray|
|00005560| 73 63 61 6c 65 2e 0d 54 | 68 65 72 65 20 69 73 20 |scale..T|here is |
|00005570| 6e 6f 20 70 72 6f 76 69 | 73 69 6f 6e 20 66 6f 72 |no provi|sion for|
|00005580| 20 6c 69 6e 65 61 72 69 | 7a 69 6e 67 20 61 20 63 | lineari|zing a c|
|00005590| 6f 6c 6f 72 20 6d 6f 6e | 69 74 6f 72 2e 20 49 6e |olor mon|itor. In|
|000055a0| 20 70 61 72 74 69 63 75 | 6c 61 72 20 69 74 20 69 | particu|lar it i|
|000055b0| 73 0d 61 73 73 75 6d 65 | 64 20 74 68 61 74 20 74 |s.assume|d that t|
|000055c0| 68 65 20 74 68 65 20 44 | 41 43 73 20 61 72 65 20 |he the D|ACs are |
|000055d0| 6c 69 6e 65 61 72 6c 79 | 20 63 6f 6d 62 69 6e 65 |linearly| combine|
|000055e0| 64 20 42 45 46 4f 52 45 | 20 74 68 65 20 64 69 73 |d BEFORE| the dis|
|000055f0| 70 6c 61 79 20 6e 6f 6e | 6c 69 6e 65 61 72 69 74 |play non|linearit|
|00005600| 79 2e 0d 4c 69 6e 65 61 | 72 69 7a 69 6e 67 20 6c |y..Linea|rizing l|
|00005610| 75 6d 69 6e 61 6e 63 65 | 20 6f 6e 20 61 20 63 6f |uminance| on a co|
|00005620| 6c 6f 72 20 64 69 73 70 | 6c 61 79 20 77 6f 75 6c |lor disp|lay woul|
|00005630| 64 20 6e 65 65 64 20 74 | 6f 20 61 6c 6c 6f 77 20 |d need t|o allow |
|00005640| 66 6f 72 20 74 68 72 65 | 65 20 64 69 66 66 65 72 |for thre|e differ|
|00005650| 65 6e 74 0d 6e 6f 6e 6c | 69 6e 65 61 72 20 74 72 |ent.nonl|inear tr|
|00005660| 61 6e 73 66 6f 72 6d 61 | 74 69 6f 6e 73 2e 0d 0d |ansforma|tions...|
|00005670| 45 58 50 4c 41 4e 41 54 | 49 4f 4e 20 4f 46 20 54 |EXPLANAT|ION OF T|
|00005680| 48 45 20 43 4f 44 45 3a | 0d 0d 50 68 79 73 69 63 |HE CODE:|..Physic|
|00005690| 61 6c 6c 79 20 79 6f 75 | 72 20 66 72 61 6d 65 73 |ally you|r frames|
|000056a0| 74 6f 72 65 20 74 72 61 | 6e 73 66 6f 72 6d 73 20 |tore tra|nsforms |
|000056b0| 65 61 63 68 20 43 4c 55 | 54 20 65 6e 74 72 79 20 |each CLU|T entry |
|000056c0| 6e 75 6d 62 65 72 20 74 | 6f 20 61 20 76 6f 6c 74 |number t|o a volt|
|000056d0| 61 67 65 20 74 68 61 74 | 0d 77 69 6c 6c 20 62 65 |age that|.will be|
|000056e0| 20 6c 69 6e 65 61 72 6c | 79 20 72 65 6c 61 74 65 | linearl|y relate|
|000056f0| 64 20 74 6f 20 74 68 65 | 20 6e 75 6d 62 65 72 2e |d to the| number.|
|00005700| 20 54 68 65 20 74 68 72 | 65 65 20 6f 75 74 70 75 | The thr|ee outpu|
|00005710| 74 20 76 6f 6c 74 61 67 | 65 73 20 77 69 6c 6c 20 |t voltag|es will |
|00005720| 62 65 0d 63 6f 6d 62 69 | 6e 65 64 20 62 79 20 74 |be.combi|ned by t|
|00005730| 68 65 20 49 53 52 20 56 | 69 64 65 6f 20 41 74 74 |he ISR V|ideo Att|
|00005740| 65 6e 75 61 74 6f 72 20 | 74 6f 20 70 72 6f 64 75 |enuator |to produ|
|00005750| 63 65 20 61 20 73 69 6e | 67 6c 65 20 76 6f 6c 74 |ce a sin|gle volt|
|00005760| 61 67 65 20 77 68 69 63 | 68 20 64 72 69 76 65 73 |age whic|h drives|
|00005770| 0d 74 68 65 20 76 69 64 | 65 6f 20 6d 6f 6e 69 74 |.the vid|eo monit|
|00005780| 6f 72 2e 20 46 69 6e 61 | 6c 6c 79 2c 20 74 68 65 |or. Fina|lly, the|
|00005790| 20 64 69 73 70 6c 61 79 | 20 6e 6f 6e 6c 69 6e 65 | display| nonline|
|000057a0| 61 72 6c 79 20 74 72 61 | 6e 73 66 6f 72 6d 73 20 |arly tra|nsforms |
|000057b0| 56 20 74 6f 20 70 72 6f | 64 75 63 65 20 61 0d 6c |V to pro|duce a.l|
|000057c0| 75 6d 69 6e 61 6e 63 65 | 20 4c 2e 20 4d 79 20 63 |uminance| L. My c|
|000057d0| 6f 6e 76 65 6e 74 69 6f | 6e 20 66 6f 72 20 22 6d |onventio|n for "m|
|000057e0| 65 61 73 75 72 69 6e 67 | 22 20 74 68 65 20 22 76 |easuring|" the "v|
|000057f0| 6f 6c 74 61 67 65 22 20 | 56 20 61 74 20 74 68 65 |oltage" |V at the|
|00005800| 20 69 6e 70 75 74 20 6f | 66 20 74 68 65 0d 6d 6f | input o|f the.mo|
|00005810| 6e 69 74 6f 72 20 69 73 | 20 74 68 61 74 20 56 3d |nitor is| that V=|
|00005820| 30 20 77 68 65 6e 20 61 | 6c 6c 20 74 68 72 65 65 |0 when a|ll three|
|00005830| 20 44 41 43 73 20 61 72 | 65 20 73 65 74 20 74 6f | DACs ar|e set to|
|00005840| 20 7a 65 72 6f 20 61 6e | 64 20 56 3d 32 35 35 20 | zero an|d V=255 |
|00005850| 77 68 65 6e 20 61 6c 6c | 20 74 68 72 65 65 0d 44 |when all| three.D|
|00005860| 41 43 73 20 61 72 65 20 | 73 65 74 20 74 6f 20 32 |ACs are |set to 2|
|00005870| 35 35 2e 20 28 54 68 69 | 73 20 77 69 6c 6c 20 62 |55. (Thi|s will b|
|00005880| 65 20 6c 69 6e 65 61 72 | 6c 79 20 72 65 6c 61 74 |e linear|ly relat|
|00005890| 65 64 20 74 6f 20 76 6f | 6c 74 73 20 6d 65 61 73 |ed to vo|lts meas|
|000058a0| 75 72 65 64 2c 20 77 69 | 74 68 20 61 0d 76 6f 6c |ured, wi|th a.vol|
|000058b0| 74 6d 65 74 65 72 2c 20 | 61 74 20 74 68 65 20 6f |tmeter, |at the o|
|000058c0| 75 74 70 75 74 20 6f 66 | 20 74 68 65 20 56 69 64 |utput of| the Vid|
|000058d0| 65 6f 20 41 74 74 65 6e | 75 61 74 6f 72 2e 29 20 |eo Atten|uator.) |
|000058e0| 54 68 65 20 76 69 72 74 | 75 65 20 6f 66 20 74 68 |The virt|ue of th|
|000058f0| 65 20 61 74 74 65 6e 75 | 61 74 6f 72 0d 69 73 20 |e attenu|ator.is |
|00005900| 74 68 61 74 20 69 74 20 | 61 6c 6c 6f 77 73 20 75 |that it |allows u|
|00005910| 73 20 74 6f 20 70 72 6f | 64 75 63 65 20 6e 6f 6e |s to pro|duce non|
|00005920| 69 6e 74 65 67 72 61 6c | 20 76 61 6c 75 65 73 20 |integral| values |
|00005930| 6f 66 20 56 2e 0d 0d 54 | 68 65 72 65 20 61 72 65 |of V...T|here are|
|00005940| 20 74 77 6f 20 67 69 76 | 65 6e 73 3a 0d 31 2e 20 | two giv|ens:.1. |
|00005950| 44 41 43 73 20 61 72 65 | 20 69 6e 61 63 63 75 72 |DACs are| inaccur|
|00005960| 61 74 65 2e 20 41 20 67 | 6f 6f 64 20 44 41 43 20 |ate. A g|ood DAC |
|00005970| 6d 61 79 20 62 65 20 73 | 70 65 63 69 66 69 65 64 |may be s|pecified|
|00005980| 20 74 6f 20 62 65 20 6d | 65 72 65 6c 79 20 6d 6f | to be m|erely mo|
|00005990| 6e 6f 74 6f 6e 69 63 2e | 20 46 6f 72 0d 70 75 72 |notonic.| For.pur|
|000059a0| 70 6f 73 65 73 20 6f 66 | 20 63 6f 6d 70 75 74 69 |poses of| computi|
|000059b0| 6e 67 20 74 68 65 20 72 | 65 74 75 72 6e 65 64 20 |ng the r|eturned |
|000059c0| 74 6f 6c 65 72 61 6e 63 | 65 20 76 61 6c 75 65 2c |toleranc|e value,|
|000059d0| 20 49 20 66 6f 6c 6c 6f | 77 20 74 68 65 20 42 72 | I follo|w the Br|
|000059e0| 6f 6f 6b 74 72 65 65 20 | 44 41 43 0d 73 70 65 63 |ooktree |DAC.spec|
|000059f0| 69 66 69 63 61 74 69 6f | 6e 20 6f 66 20 b1 31 20 |ificatio|n of .1 |
|00005a00| 4c 53 42 20 65 72 72 6f | 72 20 69 6e 20 69 6e 74 |LSB erro|r in int|
|00005a10| 65 67 72 61 74 65 64 20 | 6c 69 6e 65 61 72 69 74 |egrated |linearit|
|00005a20| 79 20 61 6e 64 20 61 73 | 73 75 6d 65 20 74 68 61 |y and as|sume tha|
|00005a30| 74 20 74 68 65 20 65 72 | 72 6f 72 0d 69 6e 20 61 |t the er|ror.in a|
|00005a40| 6e 79 20 6c 75 6d 69 6e | 61 6e 63 65 20 64 69 66 |ny lumin|ance dif|
|00005a50| 66 65 72 65 6e 63 65 20 | 69 73 20 61 74 20 6d 6f |ference |is at mo|
|00005a60| 73 74 20 b1 31 20 4c 53 | 42 2e 0d 32 2e 20 57 65 |st .1 LS|B..2. We|
|00005a70| 20 77 61 6e 74 20 74 6f | 20 6d 69 6e 69 6d 69 7a | want to| minimiz|
|00005a80| 65 20 74 68 65 20 65 72 | 72 6f 72 20 69 6e 20 72 |e the er|ror in r|
|00005a90| 65 70 72 65 73 65 6e 74 | 69 6e 67 20 74 68 65 20 |epresent|ing the |
|00005aa0| 77 61 76 65 66 6f 72 6d | 2c 20 62 75 74 20 61 72 |waveform|, but ar|
|00005ab0| 65 20 6e 6f 74 0d 70 61 | 72 74 69 63 75 6c 61 72 |e not.pa|rticular|
|00005ac0| 6c 79 20 77 6f 72 72 69 | 65 64 20 61 62 6f 75 74 |ly worri|ed about|
|00005ad0| 20 74 68 65 20 65 78 61 | 63 74 20 76 61 6c 75 65 | the exa|ct value|
|00005ae0| 20 6f 66 20 74 68 65 20 | 6d 65 61 6e 20 6c 75 6d | of the |mean lum|
|00005af0| 69 6e 61 6e 63 65 2e 20 | 54 68 75 73 2c 20 69 66 |inance. |Thus, if|
|00005b00| 20 77 65 0d 68 61 76 65 | 20 44 41 43 73 20 77 69 | we.have| DACs wi|
|00005b10| 74 68 20 64 69 66 66 65 | 72 65 6e 74 20 67 61 69 |th diffe|rent gai|
|00005b20| 6e 73 20 77 65 20 6d 61 | 79 20 66 69 78 20 74 68 |ns we ma|y fix th|
|00005b30| 65 20 63 6f 61 72 73 65 | 20 44 41 43 73 20 74 6f |e coarse| DACs to|
|00005b40| 20 73 65 74 20 74 68 65 | 20 6d 65 61 6e 0d 6c 75 | set the| mean.lu|
|00005b50| 6d 69 6e 61 6e 63 65 20 | 61 6e 64 20 76 61 72 79 |minance |and vary|
|00005b60| 20 74 68 65 20 66 69 6e | 65 20 44 41 43 73 20 74 | the fin|e DACs t|
|00005b70| 6f 20 70 72 6f 64 75 63 | 65 20 74 68 65 20 6c 69 |o produc|e the li|
|00005b80| 6e 65 61 72 20 72 61 6e | 67 65 20 6f 66 20 6c 75 |near ran|ge of lu|
|00005b90| 6d 69 6e 61 6e 63 65 73 | 0d 72 65 71 75 65 73 74 |minances|.request|
|00005ba0| 65 64 2e 0d 0d 48 65 72 | 65 27 73 20 74 68 65 20 |ed...Her|e's the |
|00005bb0| 73 74 72 61 74 65 67 79 | 2e 20 57 65 20 77 61 6e |strategy|. We wan|
|00005bc0| 74 20 74 6f 20 63 6f 76 | 65 72 20 74 68 65 20 72 |t to cov|er the r|
|00005bd0| 61 6e 67 65 20 4c 30 20 | 74 6f 20 4c 6e 20 77 69 |ange L0 |to Ln wi|
|00005be0| 74 68 20 74 68 65 20 73 | 6d 61 6c 6c 65 73 74 0d |th the s|mallest.|
|00005bf0| 70 6f 73 73 69 62 6c 65 | 20 65 72 72 6f 72 20 69 |possible| error i|
|00005c00| 6e 20 4c 2d 4c 30 2e 0d | 0d 53 74 65 70 73 20 31 |n L-L0..|.Steps 1|
|00005c10| 20 74 6f 20 35 20 68 61 | 70 70 65 6e 20 69 6e 20 | to 5 ha|ppen in |
|00005c20| 53 65 74 4c 75 6d 69 6e | 61 6e 63 65 52 61 6e 67 |SetLumin|anceRang|
|00005c30| 65 3a 0d 31 2e 20 53 6f | 72 74 20 74 68 65 20 44 |e:.1. So|rt the D|
|00005c40| 41 43 73 20 62 79 20 67 | 61 69 6e 20 67 2c 20 77 |ACs by g|ain g, w|
|00005c50| 68 65 72 65 20 67 61 69 | 6e 20 69 73 20 64 65 66 |here gai|n is def|
|00005c60| 69 6e 65 64 20 61 73 20 | 74 68 65 20 63 68 61 6e |ined as |the chan|
|00005c70| 67 65 20 69 6e 20 56 20 | 77 68 65 6e 0d 61 20 73 |ge in V |when.a s|
|00005c80| 69 6e 67 6c 65 20 44 41 | 43 20 69 73 20 69 6e 63 |ingle DA|C is inc|
|00005c90| 72 65 61 73 65 64 20 66 | 72 6f 6d 20 30 20 74 6f |reased f|rom 0 to|
|00005ca0| 20 32 35 35 2c 20 73 6f | 20 67 30 2b 67 31 2b 67 | 255, so| g0+g1+g|
|00005cb0| 32 3d 31 2e 20 4c 65 74 | 20 74 68 65 20 67 61 69 |2=1. Let| the gai|
|00005cc0| 6e 73 20 62 65 20 67 30 | 3e 67 31 3e 67 32 2e 20 |ns be g0|>g1>g2. |
|00005cd0| 0d 32 2e 20 54 72 61 6e | 73 66 6f 72 6d 20 74 68 |.2. Tran|sform th|
|00005ce0| 65 20 6c 75 6d 69 6e 61 | 6e 63 65 20 72 61 6e 67 |e lumina|nce rang|
|00005cf0| 65 20 74 6f 20 61 20 6e | 6f 6d 69 6e 61 6c 20 76 |e to a n|ominal v|
|00005d00| 6f 6c 74 61 67 65 20 72 | 61 6e 67 65 20 6c 6f 77 |oltage r|ange low|
|00005d10| 56 20 61 6e 64 20 68 69 | 67 68 56 2e 0d 33 2e 20 |V and hi|ghV..3. |
|00005d20| 44 65 63 69 64 65 20 77 | 68 69 63 68 20 44 41 43 |Decide w|hich DAC|
|00005d30| 73 20 73 68 6f 75 6c 64 | 20 62 65 20 76 61 72 69 |s should| be vari|
|00005d40| 61 62 6c 65 20 61 6e 64 | 20 77 68 69 63 68 20 73 |able and| which s|
|00005d50| 68 6f 75 6c 64 20 62 65 | 20 66 69 78 65 64 2c 0d |hould be| fixed,.|
|00005d60| 73 6f 20 61 73 20 74 68 | 65 20 6d 69 6e 69 6d 69 |so as th|e minimi|
|00005d70| 7a 65 20 74 68 65 20 74 | 6f 6c 65 72 61 6e 63 65 |ze the t|olerance|
|00005d80| 20 69 6e 20 74 68 65 20 | 6c 75 6d 69 6e 61 6e 63 | in the |luminanc|
|00005d90| 65 20 69 6e 63 72 65 6d | 65 6e 74 73 2e 0d 34 2e |e increm|ents..4.|
|00005da0| 20 54 65 6d 70 6f 72 61 | 72 69 6c 79 20 73 65 74 | Tempora|rily set|
|00005db0| 20 74 68 65 20 76 61 72 | 69 61 62 6c 65 20 44 41 | the var|iable DA|
|00005dc0| 43 73 20 74 6f 20 74 68 | 65 69 72 20 6d 69 64 70 |Cs to th|eir midp|
|00005dd0| 6f 69 6e 74 73 2e 20 4e | 6f 77 20 73 65 74 20 74 |oints. N|ow set t|
|00005de0| 68 65 20 66 69 78 65 64 | 20 44 41 43 73 20 74 6f |he fixed| DACs to|
|00005df0| 0d 6d 6f 73 74 20 61 63 | 63 75 72 61 74 65 6c 79 |.most ac|curately|
|00005e00| 20 72 65 70 72 65 73 65 | 6e 74 20 74 68 65 20 6d | represe|nt the m|
|00005e10| 69 64 70 6f 69 6e 74 20 | 6f 66 20 74 68 65 20 6e |idpoint |of the n|
|00005e20| 6f 6d 69 6e 61 6c 20 76 | 6f 6c 74 61 67 65 20 72 |ominal v|oltage r|
|00005e30| 61 6e 67 65 2c 20 28 6c | 6f 77 56 2b 68 69 67 68 |ange, (l|owV+high|
|00005e40| 56 29 2f 32 2e 0d 35 2e | 20 49 66 20 6e 65 63 65 |V)/2..5.| If nece|
|00005e50| 73 73 61 72 79 2c 20 63 | 6f 6d 70 75 74 65 20 61 |ssary, c|ompute a|
|00005e60| 20 73 6d 61 6c 6c 20 6c | 75 6d 69 6e 61 6e 63 65 | small l|uminance|
|00005e70| 20 6f 66 66 73 65 74 20 | 4c 53 68 69 66 74 20 74 | offset |LShift t|
|00005e80| 6f 20 62 72 69 6e 67 20 | 74 68 65 20 72 65 71 75 |o bring |the requ|
|00005e90| 65 73 74 65 64 20 72 61 | 6e 67 65 20 0d 6c 6f 77 |ested ra|nge .low|
|00005ea0| 56 20 74 6f 20 68 69 67 | 68 56 20 69 6e 74 6f 20 |V to hig|hV into |
|00005eb0| 74 68 65 20 72 61 6e 67 | 65 20 61 74 74 61 69 6e |the rang|e attain|
|00005ec0| 61 62 6c 65 20 62 79 20 | 74 68 65 20 76 61 72 69 |able by |the vari|
|00005ed0| 61 62 6c 65 20 44 41 43 | 73 2e 20 28 54 68 69 73 |able DAC|s. (This|
|00005ee0| 20 69 73 20 6e 65 63 65 | 73 73 61 72 79 0d 62 65 | is nece|ssary.be|
|00005ef0| 63 61 75 73 65 20 74 68 | 65 20 63 65 6e 74 65 72 |cause th|e center|
|00005f00| 69 6e 67 20 69 6e 20 73 | 74 65 70 20 34 20 6d 61 |ing in s|tep 4 ma|
|00005f10| 79 20 6e 6f 74 20 62 65 | 20 70 72 65 63 69 73 65 |y not be| precise|
|00005f20| 20 65 6e 6f 75 67 68 2e | 29 0d 0d 53 74 65 70 20 | enough.|)..Step |
|00005f30| 36 20 68 61 70 70 65 6e | 73 20 69 6e 20 5f 53 65 |6 happen|s in _Se|
|00005f40| 74 4c 75 6d 69 6e 61 6e | 63 65 3a 0d 36 2e 20 53 |tLuminan|ce:.6. S|
|00005f50| 65 74 20 74 68 65 20 76 | 61 72 69 61 62 6c 65 20 |et the v|ariable |
|00005f60| 44 41 43 73 20 69 6e 20 | 74 68 65 20 43 6f 6c 6f |DACs in |the Colo|
|00005f70| 72 53 70 65 63 20 65 6e | 74 72 79 20 73 6f 20 61 |rSpec en|try so a|
|00005f80| 73 20 74 6f 20 6d 6f 73 | 74 20 61 63 63 75 72 61 |s to mos|t accura|
|00005f90| 74 65 6c 79 20 72 65 70 | 72 65 73 65 6e 74 0d 4c |tely rep|resent.L|
|00005fa0| 2b 4c 53 68 69 66 74 2e | 0d 0d 53 65 74 4c 75 6d |+LShift.|..SetLum|
|00005fb0| 69 6e 61 6e 63 65 73 28 | 29 2c 20 53 65 74 4c 75 |inances(|), SetLu|
|00005fc0| 6d 69 6e 61 6e 63 65 73 | 41 6e 64 52 61 6e 67 65 |minances|AndRange|
|00005fd0| 28 29 2c 20 61 6e 64 20 | 53 65 74 4c 75 6d 69 6e |(), and |SetLumin|
|00005fe0| 61 6e 63 65 28 29 20 61 | 6c 6c 20 63 61 6c 6c 20 |ance() a|ll call |
|00005ff0| 5f 53 65 74 4c 75 6d 69 | 6e 61 6e 63 65 28 29 2e |_SetLumi|nance().|
|00006000| 0d 23 65 6e 64 69 66 00 | 00 00 00 00 00 00 00 00 |.#endif.|........|
|00006010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006040| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006050| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006060| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006070| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006080| 00 00 01 00 00 00 01 4c | 00 00 00 4c 00 00 00 32 |.......L|...L...2|
|00006090| 6e 63 6c 75 64 65 20 22 | 56 69 64 65 6f 54 6f 6f |nclude "|VideoToo|
|000060a0| 6c 62 6f 78 2e 68 22 0d | 0d 75 6e 73 69 67 6e 65 |lbox.h".|.unsigne|
|000060b0| 0e 4c 75 6d 69 6e 61 6e | 63 65 2e 6e 6f 74 65 4c |.Luminan|ce.noteL|
|000060c0| 02 00 00 00 50 61 72 74 | 53 49 54 21 00 00 00 00 |....Part|SIT!....|
|000060d0| 00 00 50 61 72 74 53 49 | 54 21 00 00 00 00 00 00 |..PartSI|T!......|
|000060e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000060f0| 00 00 ab bf ee 64 00 00 | 00 00 00 00 01 7e 09 75 |.....d..|.....~.u|
|00006100| 6e 73 69 67 6e 65 64 20 | 6c 6f 6e 67 20 73 65 63 |nsigned |long sec|
|00006110| 6f 6e 64 73 3b 0d 09 63 | 68 61 72 20 73 74 72 69 |onds;..c|har stri|
|00006120| 6e 67 5b 36 34 5d 3d 22 | 22 3b 0d 09 46 49 4c 45 |ng[64]="|";..FILE|
|00006130| 20 2a 69 6e 3b 0d 09 0d | 09 47 65 74 44 61 74 65 | *in;...|.GetDate|
|00006140| 54 69 6d 65 28 26 73 65 | 63 6f 6e 64 73 29 3b 0d |Time(&se|conds);.|
|00006150| 09 69 6e 3d 4e 55 4c 4c | 3b 0d 09 69 66 28 69 6e |.in=NULL|;..if(in|
|00006160| 50 74 72 21 3d 4e 55 4c | 4c 20 26 26 20 69 6e 4e |Ptr!=NUL|L && inN|
|00006170| 61 6d 65 21 3d 4e 55 4c | 4c 29 7b 0d 09 09 70 72 |ame!=NUL|L){...pr|
|00006180| 00 00 00 48 00 09 4d 6f | 6e 61 63 6f 00 00 00 00 |...H..Mo|naco....|
|00006190| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000061a0| 00 00 00 00 00 00 00 06 | 00 04 00 2a 00 03 01 8d |........|...*....|
|000061b0| 02 7d 00 3c 00 04 01 8b | 02 6c aa d2 13 1d 00 00 |.}.<....|.l......|
|000061c0| 26 09 00 00 26 09 00 00 | 00 00 00 00 00 00 01 00 |&...&...|........|
|000061d0| 00 00 01 4c 00 00 00 4c | 00 00 00 32 00 aa ef f4 |...L...L|...2....|
|000061e0| 1b 2e 00 00 00 1c 00 32 | 00 00 4d 50 53 52 00 00 |.......2|..MPSR..|
|000061f0| 00 0a 03 ed ff ff 00 00 | 00 00 00 aa ea 10 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+